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.
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
VendureLogger(message: string, context?: string, trace?: string) => void(message: string, context?: string) => void(message: string, context?: string) => void(message: string, context?: string) => void(message: string, context?: string) => void