OtelLogger
OtelLogger
A logger that emits logs to OpenTelemetry and optionally to the console.
Signature
class OtelLogger implements VendureLogger {
    constructor(options: OtelLoggerOptions)
    debug(message: string, context?: string) => void;
    warn(message: string, context?: string) => void;
    info(message: string, context?: string) => void;
    error(message: string, context?: string) => void;
    verbose(message: string, context?: string) => void;
}
- Implements: VendureLogger
constructor
method
(options: OtelLoggerOptions) => OtelLoggerdebug
method
(message: string, context?: string) => voidwarn
method
(message: string, context?: string) => voidinfo
method
(message: string, context?: string) => voiderror
method
(message: string, context?: string) => voidverbose
method
(message: string, context?: string) => voidOtelLoggerOptions
Options for the OtelLogger.
Signature
interface OtelLoggerOptions {
    logToConsole?: LogLevel;
}
logToConsole
property
If set to a LogLevel, the logger will also log to the console. This can be useful for local development or debugging.
Example
import { LogLevel } from '@vendure/core';
import { TelemetryPlugin } from '@vendure/telemetry-plugin';
// ...
TelemetryPlugin.init({
  loggerOptions: {
    logToConsole: LogLevel.Verbose,
  },
});