Skip to content

LogLevels

Juan Antonio Castillo edited this page Feb 27, 2022 · 2 revisions

What is Log Severity Level

In jachLog, each log entry have an associated severity level.

To start, it indicates and kind of message it contains. The jachLog severity levels are based on the Severity of the SysLog entries. SysLog is a industry standard for message logging.

The severity levels are: Emergency, Alert, Critical, Error, Warning, Notice, Informational, Debug.

For more information on this values, read about the standard/recommended meaning of severity level values.

How to filter out log entries based on its level

The second problem you face regarding to application logging, is the amount of log that a complex, mature and running application generates. (The first if having an application that generates no log at all).

To help you provide ways to your customers/users to deal with this problem at the origin, the class allows you to fine tune which messages are written to the destinations and which messages are just ignored at any runtime moment. You can provide means to your users to change the level of filtering of your application by just adjusting the LogLevel property for the different topics of log (or for the default topic if your application is simple and doesn't use topics).

The LogLevel property acts as a threshold of which messages are written to the destinations. For example, if you set the property to llCritical, only entries with Critical or above severity level will be written to the destinations: Emergency, Alert and Critical.

You can set the LogLevel to llOff, which means no messages will be written or llAll, which writes all messages, like llDebug.

Note that the LogLevel property is of type TLogLevel, while the log entries severity is of type TLogSeverity. There's an obvoius correspondence between both types, but the types remain different and are not interchangeable.