Logging
VWO by default logs all ERROR level messages to your server's console. To gain more control over VWO's logging behavior, you can use the logger parameter in the init configuration.
Logger Properties
Parameter | 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'. |
Example 1: Set log level to control the verbosity of logs
options = {
'account_id': '123456', # VWO Account ID
'sdk_key': '32-alpha-numeric-sdk-key', # SDK Key
'logger': {
'level': 'DEBUG'
}
}
vwo_client = init(options)
Example 2: Add a custom prefix to log messages for easier identification
options = {
'account_id': '123456', # VWO Account ID
'sdk_key': '32-alpha-numeric-sdk-key', # SDK Key
'logger': {
'level': 'DEBUG',
'prefix': 'CUSTOM LOG PREFIX'
}
}
vwo_client = init(options)
This "logger" object can be passed as one of the parameters when initializing vwoClient.
Updated about 19 hours ago