Adds a new appender to the logger.
The Appender instance to add.
ScriptError if:
null
or undefined
.Logger.setAppenders for setting multiple appenders at once and for more details on the validation of the appenders.
Sends an error log event with the provided message and optional extraFields to all appenders.
The error message to log.
Optional
extraFields: objectOptional structured data (object) to attach to the log event. May include metadata, context, etc.
Exports the current state of the logger, including level, action, error/warning counts, and critical events (warnings and errors).
An object containing the logger's state.
Gets the array of appenders currently registered with the logger.
An array of Appender instances.
Gets an array of all error and warning log events sent.
An array of LogEvent objects representing error and warning events.
Sends an informational log event with the provided message and optional extraFields to all appenders.
The informational message to log.
Optional
extraFields: objectOptional structured data (object) to attach to the log event.
Removes an appender from the logger, if the resulting array of appenders appender is not empty.
The Appender instance to remove.
Sets the array of appenders for the logger.
The array of Appender instances to set.
Sends a trace log event with the provided message and optional extraFields to all appenders.
The trace message to log.
Optional
extraFields: objectOptional structured data (object) to attach to the log event.
Sends a warning log event with the provided message and optional extraFields to all appenders.
The warning message to log.
Optional
extraFields: objectOptional structured data (object) to attach to the log event.
Represents a logging interface for capturing and managing log events at various levels. Provides methods for logging messages, querying log state, managing appenders, and exporting logger state. Implementations should ensure they should not maintain global mutable state outside the singleton and efficient log event handling.
Remarks
LoggerImpl
implementation should be implemented via singleton pattern.See