Skip to content

Commit

Permalink
chore(extension-logging): configure the http access logger for REST r…
Browse files Browse the repository at this point in the history
…outes only
  • Loading branch information
raymondfeng committed Dec 3, 2019
1 parent 02da6af commit 18ebd03
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion extensions/logging/src/interceptors/logging.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ export interface AccessLogOptions extends morgan.Options {
* A global interceptor that provides logging for http requests/responses.
*/
@bind(asGlobalInterceptor('logging'), {
tags: {[ContextTags.KEY]: LoggingBindings.WINSTON_HTTP_ACCESS_LOGGER},
tags: {
[ContextTags.KEY]: LoggingBindings.WINSTON_HTTP_ACCESS_LOGGER,
// Only apply to invocations from REST routes
[ContextTags.GLOBAL_INTERCEPTOR_SOURCE]: 'route',
},
scope: BindingScope.SINGLETON,
})
export class HttpAccessLogInterceptor implements Provider<Interceptor> {
Expand Down

0 comments on commit 18ebd03

Please sign in to comment.