[APM] fix logger on telemetry (#204388)

## Summary

Closes https://github.com/elastic/kibana/issues/199249

This PR fixes the logger calls on APM telemetry
This commit is contained in:
Sergi Romeu 2024-12-16 16:22:07 +01:00 committed by GitHub
parent 67d7547150
commit 5077e6d63d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -46,8 +46,8 @@ export function collectDataTelemetry({
} catch (err) {
// catch error and log as debug in production env and warn in dev env
const logLevel = isProd ? logger.debug : logger.warn;
logLevel(`Failed executing the APM telemetry task: "${task.name}"`);
logLevel(err);
logLevel.call(logger, `Failed executing the APM telemetry task: "${task.name}"`);
logLevel.call(logger, err);
return data;
}
});