LoggerFactory
@codification/cutwater-logging > LoggerFactory
Class
The source and single point of management for Logger instances.
beta:
Hierarchy
LoggerFactory
Properties
- DEFAULT_LOGGER
- DEFAULT_LOGGING_LEVEL
- ENV_LOGGING_LEVEL
- ENV_LOGGING_LEVEL_PREFIX
- GLOBAL_APPENDER
- GLOBAL_LEVEL
Methods
Properties
<Static> DEFAULT_LOGGER
● DEFAULT_LOGGER: string = "DEFAULT"
Defined in LoggerFactory.ts:38
The name of the default Logger.
readonly:
<Static> DEFAULT_LOGGING_LEVEL
● DEFAULT_LOGGING_LEVEL: Level = Level.ERROR
Defined in LoggerFactory.ts:44
The Level used if a default is not found under the LOGGING_LEVEL key in [[Config]].
readonly:
<Static> ENV_LOGGING_LEVEL
● ENV_LOGGING_LEVEL: string = "LOGGING_LEVEL"
Defined in LoggerFactory.ts:22
The key in [[Config]] that will be checked for a default logging level.
readonly:
<Static> ENV_LOGGING_LEVEL_PREFIX
● ENV_LOGGING_LEVEL_PREFIX: string =
LoggerFactory.ENV_LOGGING_LEVEL + '_'
Defined in LoggerFactory.ts:30
The prefix for the key in [[Config]] that will be used to determine the logging level for Logger instances with the name following the prefix.
readonly:
<Static> GLOBAL_APPENDER
● GLOBAL_APPENDER: Appender = new ConsoleAppender()
Defined in LoggerFactory.ts:53
The Appender used by all Logger instances that do not have one specified.
<Static> GLOBAL_LEVEL
● GLOBAL_LEVEL: Level
Defined in LoggerFactory.ts:49
The Level used by all Logger instances that do not have one specified.
Methods
<Static> getLogger
▸ getLogger(loggerName?: string): Logger
Defined in LoggerFactory.ts:63
Returns the Logger instance with the specified name. If no name is provided, the default will be returned. If a logger does not exist with the specified name, a new one will be created.
Parameters:
| Name | Type | Default value | Description |
|---|---|---|---|
Default value loggerName | string | this.DEFAULT_LOGGER | Name of the logger instance to be returned. |
Returns: Logger
<Static> logEnabledLevels
▸ logEnabledLevels(logger: Logger): void
Defined in LoggerFactory.ts:81
Causes the specified Logger to append a single message for each enabled Level.
Parameters:
| Name | Type | Description |
|---|---|---|
| logger | Logger | The logger to output levels for. |
Returns: void