---
title: Log Status Codes and Errors So Users See What Failed and Where
description: "How to log status and errors so Nodinite users see what failed and where: a Log Status Code on every event mapped per Log Agent, the failing message and the exception logged together, events on both sides of each hop, Non-Events alerts, and resend after the fix."
---

# <i class="fal fa-flag" aria-hidden="true"></i> 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)][1]  
*Mapping a code: on the [Log Agent][Log Agents], 500 becomes a **Warning** with a business-friendly text. Every event with that code now shows that way in [Log Views][] and on [BPM][BPMs] steps.*  

<h2 id="understanding"><i class="fal fa-network-wired" aria-hidden="true"></i> Understanding Log Status Codes</h2>

Every [Log Event][] has a numeric `LogStatus`. The number means what your [Log Agent][Log Agents] 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?][Log Status Codes] explains the mapping, and [Add or manage Log Status Codes][Manage-LogStatusCodes] 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 |

<h2 id="rules"><i class="fal fa-list-check" aria-hidden="true"></i> Rules for Status and Errors</h2>

### Set a Status on Every Event

* ✅ Agree on a short list of codes per platform, and map them on its [Log Agent][Log Agents] 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][View Exception Details] 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][Event Directions]. 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][O2C Log Event Structure].

<h2 id="act"><i class="fal fa-bell" aria-hidden="true"></i> Act on Errors</h2>

* Get an alert when errors appear, or when expected events stop coming: [Non-Events][] watches a [Log View][Log Views] and raises a [Resource][Resources] in a [Monitor View][Monitor Views], which notifies through [Alarm Plugins][].  
* Let users fix it themselves: after the cause is fixed, they can [resend the original message][Resend and Download Log Events] to its [Endpoint][Endpoints] from the Log View.  
* Show the status in business terms: a [BPM][BPMs] colours each step from the Log Status Codes of its events.  

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-file-code" aria-hidden="true"></i> [Log the Payload and Context][]  
* <i class="fal fa-compass" aria-hidden="true"></i> [Plan Your Logging with Nodinite][Logging Strategy]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-flag" aria-hidden="true"></i> [What is a Log Status Code?][Log Status Codes]  
* <i class="fal fa-bug" aria-hidden="true"></i> [View Exception Details][]  
* <i class="fal fa-arrow-right-arrow-left" aria-hidden="true"></i> [Event Directions][]  
* <i class="fal fa-clock" aria-hidden="true"></i> [Non-Events][]  
* <i class="fal fa-arrow-rotate-left" aria-hidden="true"></i> [Resend and Download Log Events][]  
* <i class="fal fa-link" aria-hidden="true"></i> [Correlate Transactions End to End][]  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/LogAgents/LogAgents_EditStatusCode.gif

[Alarm Plugins]:https://docs.nodinite.com/administration/settings/alarm-plugins/features/what-is-an-alarm-plugin/
[BPMs]:https://docs.nodinite.com/repository-model/bpms/overview/
[Correlate Transactions End to End]:https://docs.nodinite.com/getting-started/log/logging-strategy/correlate-transactions-end-to-end/
[Endpoints]:https://docs.nodinite.com/repository-model/endpoints/overview/
[Event Directions]:https://docs.nodinite.com/core-services/log-event/features/event-directions/
[Log Agents]:https://docs.nodinite.com/administration/log-management/log-agents/features/what-is-a-log-agent/
[Log Event]:https://docs.nodinite.com/core-services/log-event/overview/
[Log Status Codes]:https://docs.nodinite.com/administration/log-management/log-agents/features/what-is-a-log-status-code/
[Log the Payload and Context]:https://docs.nodinite.com/getting-started/log/logging-strategy/log-the-payload-and-context/
[Log Views]:https://docs.nodinite.com/administration/log-management/log-views/features/what-is-a-log-view/
[Logging Strategy]:https://docs.nodinite.com/getting-started/log/logging-strategy/overview/
[Manage-LogStatusCodes]:https://docs.nodinite.com/administration/log-management/log-agents/features/add-or-manage-log-agent/#add-or-manage-log-status-codes
[Monitor Views]:https://docs.nodinite.com/administration/monitor-management/monitor-views/features/what-is-a-monitor-view/
[Non-Events]:https://docs.nodinite.com/logging-and-monitoring/non-events/overview/
[O2C Log Event Structure]:https://docs.nodinite.com/repository-model/bpms/examples/order-to-cash/o2c-log-event-structure/#log-status-handling
[Order-to-Cash demo]:https://docs.nodinite.com/repository-model/bpms/examples/order-to-cash/generate-o2c-demo-data/
[Resend and Download Log Events]:https://docs.nodinite.com/administration/log-management/log-views/features/resend-and-download-log-events/
[Resources]:https://docs.nodinite.com/administration/monitor-management/resources/features/what-is-a-resource/
[Serilog]:https://docs.nodinite.com/logging-and-monitoring/serilog/overview/
[View Exception Details]:https://docs.nodinite.com/getting-started/log/view-exception-details/