Logging
VWO by default logs all ERROR level messages to your server console.
To gain more control over VWO's logging behaviour, you can use this logger object as shown below.
logger: {
level: vwo.LogLevelEnum.DEBUG, // DEBUG, INFO, ERROR, TRACE, WARN
prefix: 'CUSTOM LOG PREFIX', // 'VWO-SDK' default
transport: { // Custom Logger implementation
debug: msg => console.log(msg),
info: msg => console.log(msg),
warn: msg => console.log(msg),
error: msg => console.log(msg),
trace: msg => console.log(msg)
}
}
vwo.init({
sdkKey: '...',
accountId: '123456',
logger: logger
});
This "logger" object can be passed as one of the parameters when initializing vwoClient.
logger Properties
Paramter | Type | Description |
---|---|---|
level | String | Level or Type of error. Could be one of the following : DEBUG, INFO, ERROR, TRACE, WARN |
prefix | String | The text that is prefixed to the error messages when logged. Defaults to 'VWO-SDK'. |
transport | Object | Map of functions that control the logging behaviour of each type of log message. |
Updated 3 months ago
What’s Next