Intentional logging events
With intentional logging, it is possible to log events that exist in the context of
business processes. For example, while handling a HTTP request, you can distinguish the
following events:
- The start of the request, when the code starts working with the request.
- The completion of the request, which completes with some result of success or failure.
Other logging events occur at specific points in time, for example:
- Errors
- Status changes
- Debug events
Types of logging events
With intentional logging, it is possible to log the following type of events.
| Event | When logged | Description |
|---|---|---|
logStart |
At the start of an operation | Logs the start of an operation. |
logStop |
At the end of an operation | Logs a successful end of an operation. This is somewhat generic terminating event. Use this event type to log the end of a process that successfully ended with any special result. |
logResult |
At the end of an operation | Logs the successful end of an operation with additional parameters. Use this
type of event if a process ends with some interesting results. Log the results
as one of the following:
|
logFail |
At the end of an operation | Logs an unsuccessful end of an operation. Use this type of event if a process
ends because of problems. If this occurs, ensure that log additional details
related to the failure. You can use this type of event with the
logError event type, which is intended to be used for error
messages. |
logStatus |
At any point in the operation | Logs metric-like values or status change events. You can use this event type
to log the status of any of the following:
|
logError |
At any point in the operation | Logs an error or an exception. |
logDebugEvent |
At any point in the operation | Logs a detailed event on the DEBUG level. This is the only event logged on the DEBUG level. |
These event types correlate with specific methods of the same name on the IntentionalLogger interface.
