diff --git a/x-pack/plugins/observability_solution/apm/server/lib/apm_telemetry/collect_data_telemetry/index.ts b/x-pack/plugins/observability_solution/apm/server/lib/apm_telemetry/collect_data_telemetry/index.ts index 2da87653c0707..b0e2d99fefd5b 100644 --- a/x-pack/plugins/observability_solution/apm/server/lib/apm_telemetry/collect_data_telemetry/index.ts +++ b/x-pack/plugins/observability_solution/apm/server/lib/apm_telemetry/collect_data_telemetry/index.ts @@ -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; } });