- 3 minutes to read

Log Status and Errors

A log full of events that all look the same tells nobody what went wrong. Good error handling in logging means the status on each event, and the message that failed next to the error, turn a list into an answer: this order, this step, this reason. Then support can fix it, and often resend it, without calling you.

  • ✅ Show success, warning, and error in the colours business users understand
  • ✅ Log the failing message together with the exception
  • ✅ See where a transaction stopped, and get an alert when it does

Walkthrough: on the Log Agent Contoso Shipping Platform - Test, change the Log Status Code 500 from Error to Warning with a new description and save; the card shows an orange flag (7.12)
Mapping a code: on the Log Agent, 500 becomes a Warning with a business-friendly text. Every event with that code now shows that way in Log Views and on BPM steps.

Understanding Log Status Codes

Every Log Event has a numeric LogStatus. The number means what your Log Agent says it means: each Log Agent has its own list that maps each code to a Status Type (None, Information, Success, Warning, or Error) and a text. That is how 0 can be success for one platform and an error for another. What is a Log Status Code? explains the mapping, and Add or manage Log Status Codes shows where to set it.

Status Type Use it for Example
Success A step that did what it should Order accepted by the ERP
Information A step worth knowing about, no action needed Order received, waiting for stock
Warning Done, but someone should look Order accepted with a missing delivery date
Error Failed; someone must act ERP rejected the order

Rules for Status and Errors

Set a Status on Every Event

  • ✅ Agree on a short list of codes per platform, and map them on its Log Agent before go-live
  • ✅ Use the same codes for the same outcome in every integration of that platform
  • ❌ Don't log everything as 0: users can then only search on text

Log the Message with the Error

  • ✅ When a step fails, log an event with an error status and the message it failed on, so support sees what was sent
  • ✅ Put exceptions in the context, not only in the body: the Serilog sinks write it to the ExtendedProperties/1.0#Exception property, which the exception viewer shows as a readable chain
  • ✅ Log a short, human LogText, such as ERP rejected the order: unknown customer
  • ❌ Don't swallow errors in a catch block without logging them

Log Both Sides of Every Hop

Log on the way in and on the way out of each system, with the right Event Direction. When an order has a receive event and no send event, everyone sees where it stopped. The Order-to-Cash demo marks the last send event of an incomplete order with status -1337, while its receive event keeps 0; see its Log Status handling.

Act on Errors

Next Steps