From 7a892634d8944dc8c08ce04099ba123d24dd68b0 Mon Sep 17 00:00:00 2001 From: "Christiane (Tina) Heiligers" Date: Mon, 6 Mar 2023 15:12:33 -0700 Subject: [PATCH] [http] Add log for route path access (#152621) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../core/http/core-http-server-internal/src/http_server.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/core/http/core-http-server-internal/src/http_server.ts b/packages/core/http/core-http-server-internal/src/http_server.ts index 1ef5be6c67a54..2bdf76ee23310 100644 --- a/packages/core/http/core-http-server-internal/src/http_server.ts +++ b/packages/core/http/core-http-server-internal/src/http_server.ts @@ -516,6 +516,7 @@ export class HttpServer { } private configureRoute(route: RouterRoute) { + const optionsLogger = this.log.get('options'); this.log.debug(`registering route handler for [${route.path}]`); // Hapi does not allow payload validation to be specified for 'head' or 'get' requests const validate = isSafeMethod(route.method) ? undefined : { payload: true }; @@ -526,6 +527,12 @@ export class HttpServer { xsrfRequired: route.options.xsrfRequired ?? !isSafeMethod(route.method), access: route.options.access ?? (route.path.startsWith('/internal') ? 'internal' : 'public'), }; + // Log HTTP API target consumer. + optionsLogger.debug( + `access [${kibanaRouteOptions.access}] [${route.method.toUpperCase()}] for path [${ + route.path + }]` + ); this.server!.route({ handler: route.handler,