Skip to main content

When initializing the library you have the option to pass in a custom logger. The custom logger should have a defined write(logEvent) method, where the received logEvent parameter holds information about the incident.

const config = {
logger: {
write(logEvent) {
if (logEvent.level === 'error') {
console.log(logEvent.message, logEvent.layer);
}
}
}
};
const jabra = await init(config);

Read more about configuration in the API Reference on IConfig.

See code sample

Each log event has a log level property denoting the severity. The log level can be used to filter what gets logged. Read about each member in the API reference on LogLevel. In addition, the log event will show in which layer of the stack the error occurred. Explanation of the different layers and enum member values are available in the documentation on StackLayer.

The Native Console Application and the Chrome Extension will forward error messages to the custom logger, so you can collect all logs from this method - and optionally extend it with your own app specific logging.

The Jabra library does not provide a way of saving log files - this implementation detail is up to you. We strongly recommend saving logs, either to a file on the filesystem or using a cloud logging service.