creates a new Logger instance.
the scope name(s) for this logger. can be a string or array of strings
configuration options including level, timestamp, colourization, and metadata
adds a transport to this logger instance. transports determine where log entries are sent (console, file, network, etc.).
the transport to add
creates a child logger with additional scope. child loggers inherit all transports from their parent.
additional scope to append to the current scope
options to override from parent logger
new Logger
instance with extended scope
removes all transports from this logger instance. after calling this, log entries will not be output anywhere until new transports are added.
removes a specific transport from this logger instance.
the transport instance to remove
creates a new logger instance with additional metadata. useful for adding context information to all log entries from this logger.
additional metadata to merge with existing metadata
new logger instance with combined metadata
Static
getStatic
setsets the global log level for all logger instances. affects all existing and future logger instances unless they have an explicit level set.
the log level to set globally
main
Logger
class. provides hierarchical logging with customizable transports, formatters, and scopes. supports child loggers for organized logging across application components.Example: basic usage
Example: with child loggers
Example: with custom transports