Custom Logs
Overview
Send log messages with customized severity levels, extra data and/or custom labels. Use CoralogixLogSeverity
to define severity levels for logs in the Coralogix system.
Note
You can pass any key:value
to the extra data object.
Case | Raw value | Severity level |
---|---|---|
debug |
1 | Debug |
verbose |
2 | Verbose |
info |
3 | Informational |
warn |
4 | Warning |
error |
5 | Error |
critical |
6 | Critical |
Examples
Custom severity level
Custom severity level, extra data
CoralogixRum.log(
CoralogixLogSeverity.Error, 'this is an error custom log with extra data', { data: 'tbd' });
)
Direct severity level call, extra data
Custom log, extra data and label
CoralogixRum.warning(
'this is a custom log message with warning severity',
{
data: 'tbd',
},
{
my_label_key: 'my label value',
}
);
Custom severity level, optional extra data (unless label is provided)
The extra data is optional unless labels are specified. If labels are present, extra data becomes required, though it may be set to null
if no data is available.
CoralogixRum.log(CoralogixLogSeverity.Info, 'this is a custom log message with info severity', null, {
my_label_key: 'my label value',
});
Theme
Light