Logger
The Logger is responsible for all logging in a Vendure application.
It is intended to be used as a static class:
Example
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
- Implements: LoggerService
logger
property
VendureLoggererror
method
(message: string, context?: string, trace?: string) => voidwarn
method
(message: string, context?: string) => voidinfo
method
(message: string, context?: string) => voidverbose
method
(message: string, context?: string) => voiddebug
method
(message: string, context?: string) => voidWas this chapter helpful?