When trying to set the Log Level to something like WARN or ERROR this should be possible via the environment variable OTEL_LOG_LEVEL.
Looking at the current implementation this is currently being done like this:
|
diag.setLogger(cds.log('telemetry'), process.env.OTEL_LOG_LEVEL || getDiagLogLevel()) |
The issue is that the library used (opentelemetry) checks if this value is of type number.
if (typeof optionsOrLogLevel === 'number') {
optionsOrLogLevel = {
logLevel: optionsOrLogLevel,
};
}
Which it can't be since it is being read straight from process.env which has everything as strings.
Should this issue be fixed in opentelemetry or in this library?
When trying to set the Log Level to something like
WARNorERRORthis should be possible via the environment variable OTEL_LOG_LEVEL.Looking at the current implementation this is currently being done like this:
telemetry/lib/index.js
Line 63 in c2a762e
The issue is that the library used (opentelemetry) checks if this value is of type number.
Which it can't be since it is being read straight from process.env which has everything as strings.
Should this issue be fixed in opentelemetry or in this library?