Skip to main content

Logging

The platform provides a static entry-point object, Eleflex.Logger which is consumed throughout the various layers of the application for storing system logging information. By using logging throughout your module, you can detect system health or error conditions that require further debugging. The Eleflex.Logger class contains the following property:

The application integrates with the open source project Common.Logging as it is used by other open source projects used in the system. The ILoggingService service contains multiple overloads of the following logging methods:

The following examples show the various overloads to call on a method for the Logger object:

    
    Logger.Current.Debug<MyClass>(“Something happened”);
    Logger.Current.Debug<MyClass>(exception);
    Logger.Current.Debug<MyClass>(“Something happened with an exception”, exception);
    Logger.Current.Debug(“MyClass”,“Something happened”);
    Logger.Current.Debug(“MyClass”,“Something happened with an exception”, exception);

While processing a request, we don’t want log messages to be tied to the current Unit of Work as it may be rolled back instead of committed. The underlying mechanism for the ILoggingService uses a background thread to process log messages, ensuring that they are operated on a separate thread outside the scope of the calling process that created the log message. This additionally provides the benefit to the calling process not having to wait for log messages to be stored and can continue on with its own processing.

Messages stored with the ILoggingService using the Eleflex.LogMessage object, which are stored in with database in the table EleflexV3.LogMessage. To manipulate the LogMessage objects in storage, you would use with the ILogMessageServiceRepository the ILogMessageBusinessRepository, or the ILogStorageRepository.