ILogger
Implemented by
Index
Methods
alert
Parameters
message: string
The log message.
optionalpayload: LogPayload
A map of key-value pairs that provides additional data to be logged.
Returns void
critical
Critical events cause more severe problems or outages.
Example:
Logger.critical('An error occurred.', { status: 500, error: new Error('Something went wrong.') });
Parameters
message: string
The log message.
optionalpayload: LogPayload
A map of key-value pairs that provides additional data to be logged.
Returns void
debug
Debug or trace information.
Example:
Logger.debug('The server is running.');
Logger.debug('The server is running.', { port: 3000 });Parameters
message: string
The log message.
optionalpayload: LogPayload
A map of key-value pairs that provides additional data to be logged.
Returns void
default
The log entry has no assigned severity level.
Example:
Logger.default('The server is running.');
Logger.default('The server is running.', { port: 3000 });Parameters
message: string
The log message.
optionalpayload: LogPayload
A map of key-value pairs that provides additional data to be logged.
Returns void
emergency
One or more systems are unusable.
Example:
Logger.emergency('An error occurred.', { status: 500, error: new Error('Something went wrong.') });
Parameters
message: string
The log message.
optionalpayload: LogPayload
A map of key-value pairs that provides additional data to be logged.
Returns void
error
Error events are likely to cause problems.
Example:
Logger.error('An error occurred.', { status: 500, error: new Error('Something went wrong.') });
Parameters
message: string
The log message.
optionalpayload: LogPayload
A map of key-value pairs that provides additional data to be logged.
Returns void
info
Routine information, such as ongoing status or performance.
Example:
Logger.info('The server is running.');
Logger.info('The server is running.', { port: 3000 });Parameters
message: string
The log message.
optionalpayload: LogPayload
A map of key-value pairs that provides additional data to be logged.
Returns void
notice
Normal but significant events, such as start up, shut down, or a configuration change.
Example:
Logger.notice('The server is running.');
Logger.notice('The server is running.', { port: 3000 });Parameters
message: string
The log message.
optionalpayload: LogPayload
A map of key-value pairs that provides additional data to be logged.
Returns void
warning
Warning events might cause problems.
Example:
Logger.warning('Unauthorized access.', { status: 401 });
Parameters
message: string
The log message.
optionalpayload: LogPayload
A map of key-value pairs that provides additional data to be logged.
Returns void
A person must take an action immediately.
Example: