Skip to main content

Logger

The Logger is responsible for all logging in a Vendure application.

It is intended to be used as a static class:

Example

Ts

The actual implementation - where the logs are written to - is defined by the VendureLogger instance configured in the VendureConfig. By default, the DefaultLogger is used, which logs to the console.

Implementing a custom logger

A custom logger can be passed to the logger config option by creating a class which implements the VendureLogger interface. For example, here is how you might go about implementing a logger which logs to a file:

Example

Ts
Signature
  • Implements: LoggerService

logger

error

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

warn

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

info

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

verbose

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

debug

method(message: string, context?: string) => void
Was this chapter helpful?
Report Issue
Edited Feb 23, 2026ยทEdit this page