BetaBetaLogs a debug message
Use for detailed diagnostic information useful during development and troubleshooting. Debug logs are typically disabled in production and should include technical details like internal state, intermediate values, or execution flow.
The log message
Optionaldata: LogDataOptional additional data to include with the log entry
BetaLogs an error message
Use for failures and exceptions that prevent normal operation or indicate something has gone wrong. Error logs should always describe what failed and include relevant context to aid in diagnosis.
The log message
Optionalerror: ErrorOptional error object
Optionaldata: LogDataOptional additional data to include with the log entry
BetaLogs an informational message
Use for significant application events that represent normal behavior. Info logs should capture key milestones, successful operations, or state transitions that are useful for understanding application flow in production.
The log message
Optionaldata: LogDataOptional additional data to include with the log entry
BetaLogs a warning message
Use for unexpected situations that don't prevent the application from functioning but may indicate potential issues, deprecated usage, or suboptimal conditions. Warnings should be actionable and suggest something that may need attention.
The log message
Optionaldata: LogDataOptional additional data to include with the log entry
Logger service for writing log messages to configured handlers
Loggers are created from a LoggerFactory with a specific scope/category. All log messages written to a logger will be sent to all handlers configured in the factory.
Example