Skip to content

Commit

Permalink
Adds route method to options logger logs, implement PR nit
Browse files Browse the repository at this point in the history
  • Loading branch information
TinaHeiligers committed Mar 6, 2023
1 parent 4ccb36c commit fb86412
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ export class HttpServer {
}

private configureRoute(route: RouterRoute) {
const optionsLogger = this.logger.get('http', 'server', this.name, 'options');
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 };
Expand All @@ -528,7 +528,11 @@ export class HttpServer {
access: route.options.access ?? (route.path.startsWith('/internal') ? 'internal' : 'public'),
};
// Log HTTP API target consumer.
optionsLogger.debug(`access [${kibanaRouteOptions.access}] for path [${route.path}]`);
optionsLogger.debug(
`access [${kibanaRouteOptions.access}] [${route.method.toUpperCase()}] for path [${
route.path
}]`
);

this.server!.route({
handler: route.handler,
Expand Down

0 comments on commit fb86412

Please sign in to comment.