DefaultLogger

DefaultLogger

DefaultLogger

The default logger, which logs to the console (stdout) with optional timestamps. Since this logger is part of the default Vendure configuration, you do not need to specify it explicitly in your server config. You would only need to specify it if you wish to change the log level (which defaults to LogLevel.Info) or remove the timestamp.

Example

import { DefaultLogger, LogLevel, VendureConfig } from '@vendure/core';

export config: VendureConfig = {
    // ...
    logger: new DefaultLogger({ level: LogLevel.Debug, timestamp: false }),
}

Signature

class DefaultLogger implements VendureLogger {
  constructor(options?: { level?: LogLevel; timestamp?: boolean })
  setDefaultContext(defaultContext: string) => ;
  error(message: string, context?: string, trace?: string | undefined) => void;
  warn(message: string, context?: string) => void;
  info(message: string, context?: string) => void;
  verbose(message: string, context?: string) => void;
  debug(message: string, context?: string) => void;
}

Members

constructor

method
type:
(options?: { level?: LogLevel; timestamp?: boolean }) => DefaultLogger

setDefaultContext

method
type:
(defaultContext: string) =>

error

method
type:
(message: string, context?: string, trace?: string | undefined) => void

warn

method
type:
(message: string, context?: string) => void

info

method
type:
(message: string, context?: string) => void

verbose

method
type:
(message: string, context?: string) => void

debug

method
type:
(message: string, context?: string) => void