Describes an entry to write to the log.

interface LogEntry {
    error?: Error;
    level: LogLevel;
    message: string;
    messageArgs: unknown[];
    messageResource?: string;
    time: Date;
}

Properties

error?: Error

An error associated with this log entry.

level: LogLevel

The log level.

message: string

The message to log. It has already been fully formatted and translated.

messageArgs: unknown[]

Values for positional placeholders in the message string.

messageResource?: string

The language resource key corresponding to the message if one was provided. This can be used along with messageArgs to re-translate the message into other languages.

time: Date

The timestamp indicating when the entry was created.