CompositeLogger class

Aggregates all loggers from component references under a single component.

It allows to log messages and conveniently send them to multiple destinations.

References

  • *:logger:*:*:1.0 (optional) ILogger components to pass log messages

See ILogger

Example

 MyComponent implements IConfigurable, IReferenceable {
     var _logger = new CompositeLogger();

    void configure(ConfigParams config) {
        _logger.configure(config);
        ...
    }

    void setReferences(IReferences references) {
        _logger.setReferences(references);
        ...
    }

    myMethod(String correlationId) {
        _logger.debug(correlationId, 'Called method mycomponent.mymethod');
        ...
    }
}
Inheritance

Constructors

CompositeLogger([IReferences? references])
Creates a new instance of the logger.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source String?
getter/setter pairinherited

Methods

composeError(Exception error) String
Composes an human-readable error description
inherited
configure(ConfigParams config) → void
Configures component by passing configuration parameters.
inherited
debug(String? correlationId, String message, [List? args]) → void
Logs a high-level debug information for troubleshooting.
inherited
error(String? correlationId, Exception? error, String message, [List? args]) → void
Logs recoverable application error.
inherited
fatal(String? correlationId, Exception? error, String message, [List? args]) → void
Logs fatal (unrecoverable) message that caused the process to crash.
inherited
getLevel() LogLevel
Gets the maximum log level. Messages with higher log level are filtered out.
inherited
getSource() String?
Gets the source (context) name.
inherited
info(String? correlationId, String message, [List? args]) → void
Logs an important information message
inherited
log(LogLevel level, String? correlationId, Exception? error, String message, [List? args]) → void
Logs a message at specified log level.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setLevel(LogLevel value) → void
Set the maximum log level.
inherited
setReferences(IReferences references) → void
Sets references to dependent components.
override
setSource(String value) → void
Sets the source (context) name.
inherited
toString() String
A string representation of this object.
inherited
trace(String? correlationId, String message, [List? args]) → void
Logs a low-level debug information for troubleshooting.
inherited
warn(String? correlationId, String message, [List? args]) → void
Logs a warning that may or may not have a negative impact.
inherited
write(LogLevel level, String? correlationId, Exception? error, String message) → void
Writes a log message to the logger destination(s).
override

Operators

operator ==(Object other) bool
The equality operator.
inherited