Codeunit 70623694 EOS004 App Logger
Provides a framework for logging messages from apps to multiple underlying loggers.
procedure Reset()
Resets the logger, removing all configuration and cached data.
procedure Initialize(AppId: Guid; Category: Text): Boolean
Initializes the logger with the specified app and category.
AppId Guid
The app id.
Category Text[]
The category.
Returns Boolean
true
if the logger was actually initialized, false
if it already was initialized.
procedure Initialize(App: ModuleInfo; Category: Text): Boolean
Initializes the logger with the specified app and category.
App ModuleInfo
The app.
Category Text[]
The category.
Returns Boolean
true
if the logger was actually initialized, false
if it already was initialized.
procedure AutoFlushLimit(): Integer
Integer
procedure AutoFlushLimit(NewValue: Integer)
Integer
procedure InitializeFromCaller(Category: Text): Boolean
Initializes the logger from the calling app and the given category.
Category Text[]
The category.
Returns Boolean
true
if the logger was actually initialized, false
if it already was initialized.
procedure LogMessage(EventId: Text; Message: Text)
Logs a message to all underlying loggers with the specified event id and message.
EventId Text[]
The event id.
Message Text[]
The message.
procedure LogMessage(EventId: Text; Message: Text; Payload: Dictionary of [Text, Text])
Logs a message to all underlying loggers with the specified event id and message. Includes additional properties through the payload.
EventId Text[]
The event id.
Message Text[]
The message.
Payload Dictionary[Text,Text]
The additional properties payload.
procedure LogMessage(EventId: Text; Message: Text; Verbosity: Verbosity; DataClassification: DataClassification; Scope: TelemetryScope)
Logs a message to all underlying loggers with the specified properties.
EventId Text[]
The event id.
Message Text[]
The message.
Verbosity Verbosity
The verbosity.
DataClassification DataClassification
The data classification.
Scope TelemetryScope
The scope.
procedure LogMessage(EventId: Text; Message: Text; Verbosity: Verbosity; DataClassification: DataClassification; Scope: TelemetryScope; Payload: Dictionary of [Text, Text])
Logs a message to all underlying loggers with the specified properties.
EventId Text[]
The event id.
Message Text[]
The message.
Verbosity Verbosity
The verbosity.
DataClassification DataClassification
The data classification.
Scope TelemetryScope
The scope.
Payload Dictionary[Text,Text]
The additional properties payload.
procedure IsEnabled(): Boolean
Specifies whether there exist any enabled underlying loggers. If this instance has not yet been initialized, this will always return false.
Returns Boolean
true
if there exist any enabled underlying loggers, false
otherwise.
procedure CollectLogCategories(AppId: Guid; var TempLogCategory: Record "EOS004 App Log Category")
Collects all log categories for the specified app. This method can be called even if the instance has not been initialized.
AppId Guid
The app id.
TempLogCategory Record "EOS004 App Log Category"
Will contain all categories for the given app.
procedure Flush(): Integer
Flushes all underlying loggers.
Returns Integer
The total number of log entries that were flushed.
local procedure OnCollectLogCategories(AppId: Guid; var TempLogCategory: Record "EOS004 App Log Category")
Raised when collecting log categories for the specified app. Subscribe to this to provide categories your app can log to. You must provide at least one non-empty category in order for your app to be usable by this logger framework.
AppId Guid
The Id of the app for which categories are requested.
TempLogCategory Record "EOS004 App Log Category"
The record containing the log categories for the app.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.