Creates a new instance of this logger.
Removes all [[LogMessage LogMessages]] from this object's cache.
Closes component and frees used resources.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Composes an Error string, which can be used in a log entry.
the Error to compose a string with.
the string created using the information from the Error. Example error string: "<error's message> StackTrace: <error's stack>"
Configures component by passing configuration parameters.
configuration parameters to be set.
Logs a message using the [[LogLevel.Debug debug]] log level. Calls this class's formatAndWrite method with level set to [[LogLevel.Debug]].
unique business transaction id to trace calls across components.
the message to log as debug or the format string to use for formatting.
the arguments to format message
with if it is a format string.
Dumps the [[LogMessage LogMessages]] that are stored in this object's cache to memory.
Logs a message using the [[LogLevel.Error error]] log level. Calls this class's formatAndWrite method with level set to [[LogLevel.Error]].
unique business transaction id to trace calls across components.
the Error to include in the log entry.
the message to log as error or the format string to use for formatting.
the arguments to format message
with if it is a format string.
Logs a message using the [[LogLevel.Fatal fatal]] log level. Calls this class's formatAndWrite method with level set to [[LogLevel.Fatal]].
unique business transaction id to trace calls across components.
the Error to include in the log entry.
the message to log as fatal or the format string to use for formatting.
the arguments to format message
with if it is a format string.
If message
is a printf
-like format string, then this method formats it
using the provided arguments and calls write with the newly formatted string.
the LogLevel to use.
unique business transaction id to trace calls across components.
the Error to include in the log entry for fatal and error logs.
the message to log or the format string to use for formatting.
the arguments to format message
with.
Retrieves the [[LogLevel]] that is currently set.
this logger's LogLevel.
Retrieves the source (context) for which this logger is logging.
this logger's source (context).
Logs a message using the [[LogLevel.Info info]] log level. Calls this class's formatAndWrite method with level set to [[LogLevel.Info]].
unique business transaction id to trace calls across components.
the message to log as info or the format string to use for formatting.
the arguments to format message
with if it is a format string.
Checks if the component is opened.
true if the component has been opened and false otherwise.
Logs a message using the given [[LogLevel]] and parameters. Uses this class's formatAndWrite method.
the LogLevel to use.
unique business transaction id to trace calls across components.
the Error to include in the log entry for fatal and error logs.
the message to log or the format string to use for formatting.
the arguments to format message
with if it is a format string.
Opens the component.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Saves log messages from the cache.
a list with log messages
callback function that receives error or null for success.
Sets this logger's [[LogLevel]].
the LogLevel to set this logger to.
Sets references to dependent components.
references to locate the component dependencies.
Sets the source (context) for which this logger will be logging.
the source (context) to set.
Logs a message using the [[LogLevel.Trace trace]] log level. Calls this class's formatAndWrite method with level set to [[LogLevel.Trace]].
unique business transaction id to trace calls across components.
the message to log as trace or the format string to use for formatting.
the arguments to format message
with if it is a format string.
Logs a message using the [[LogLevel.Warn warn]] log level. Calls this class's formatAndWrite method with level set to [[LogLevel.Warn]].
unique business transaction id to trace calls across components.
the message to log as warn or the format string to use for formatting.
the arguments to format message
with if it is a format string.
Writes a log message to the logger destination.
a log level.
(optional) transaction id to trace execution through call chain.
a human-readable message to log.
Generated using TypeDoc
Logger that writes log messages to AWS Cloud Watch Log.
Configuration parameters
References
*:context-info:*:*:1.0
(optional) ContextInfo to detect the context id and specify counters source*:discovery:*:*:1.0
(optional) IDiscovery services to resolve connections*:credential-store:*:*:1.0
(optional) Credential stores to resolve credentialsCounter (in the Pip.Services components package)
CachedCounters (in the Pip.Services components package)
CompositeLogger (in the Pip.Services components package)
Example
let logger = new Logger(); logger.config(ConfigParams.fromTuples( "stream", "mystream", "group", "mygroup", "connection.region", "us-east-1", "connection.access_id", "XXXXXXXXXXX", "connection.access_key", "XXXXXXXXXXX" )); logger.setReferences(References.fromTuples( new Descriptor("pip-services", "logger", "console", "default", "1.0"), new ConsoleLogger() )); logger.open("123", (err) => { ... }); logger.setLevel(LogLevel.debug); logger.error("123", ex, "Error occured: %s", ex.message); logger.debug("123", "Everything is OK.");