From d31c8905be513449a11e01468c6459102df0c28b Mon Sep 17 00:00:00 2001 From: Sonja Krause-Harder Date: Mon, 11 May 2020 15:07:58 +0200 Subject: [PATCH] Use logger in package install handler. --- .../ingest_manager/server/routes/epm/handlers.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/ingest_manager/server/routes/epm/handlers.ts b/x-pack/plugins/ingest_manager/server/routes/epm/handlers.ts index fd3a9c520b90a..6855f56bf7706 100644 --- a/x-pack/plugins/ingest_manager/server/routes/epm/handlers.ts +++ b/x-pack/plugins/ingest_manager/server/routes/epm/handlers.ts @@ -27,6 +27,7 @@ import { installPackage, removeInstallation, } from '../../services/epm/packages'; +import { appContextService } from '../../services'; export const getCategoriesHandler: RequestHandler = async (context, request, response) => { try { @@ -121,10 +122,12 @@ export const getInfoHandler: RequestHandler> = async (context, request, response) => { + const logger = appContextService.getLogger(); + const { pkgkey } = request.params; + const savedObjectsClient = context.core.savedObjects.client; + const callCluster = context.core.elasticsearch.adminClient.callAsCurrentUser; + if (logger) logger.info(`Attempting installation of package ${pkgkey}.`); try { - const { pkgkey } = request.params; - const savedObjectsClient = context.core.savedObjects.client; - const callCluster = context.core.elasticsearch.adminClient.callAsCurrentUser; const res = await installPackage({ savedObjectsClient, pkgkey, @@ -136,6 +139,7 @@ export const installPackageHandler: RequestHandler