Skip to content

Commit 9782097

Browse files
committed
chore(extension-logging): configure the http access logger for REST routes only
1 parent cadc4b2 commit 9782097

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

extensions/logging/src/interceptors/logging.interceptor.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ export interface AccessLogOptions extends morgan.Options {
7575
* A global interceptor that provides logging for http requests/responses.
7676
*/
7777
@bind(asGlobalInterceptor('logging'), {
78-
tags: {[ContextTags.KEY]: LoggingBindings.WINSTON_HTTP_ACCESS_LOGGER},
78+
tags: {
79+
[ContextTags.KEY]: LoggingBindings.WINSTON_HTTP_ACCESS_LOGGER,
80+
// Only apply to invocations from REST routes
81+
[ContextTags.GLOBAL_INTERCEPTOR_SOURCE]: 'route',
82+
},
7983
scope: BindingScope.SINGLETON,
8084
})
8185
export class HttpAccessLogInterceptor implements Provider<Interceptor> {

0 commit comments

Comments
 (0)