Skip to content

Commit c3359d6

Browse files
Update logger.md
1 parent 7711d59 commit c3359d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/techniques/logger.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,13 @@ This should be suitable for most cases. But if you need more customization (like
184184

185185
#### Injecting a custom logger
186186

187-
To start, extend the built-in logger with code like the following. We supply the `scope` option as configuration metadata for the `Logger` class, specifying a [transient](/fundamentals/injection-scopes) scope, to ensure that we'll have a unique instance of the `MyLogger` in each feature module. In this example, we do not extend the individual `Logger` methods (like `log()`, `warn()`, etc.), though you may choose to do so.
187+
To start, extend the built-in logger with code like the following. We supply the `scope` option as configuration metadata for the `ConsoleLogger` class, specifying a [transient](/fundamentals/injection-scopes) scope, to ensure that we'll have a unique instance of the `MyLogger` in each feature module. In this example, we do not extend the individual `ConsoleLogger` methods (like `log()`, `warn()`, etc.), though you may choose to do so.
188188

189189
```typescript
190-
import { Injectable, Scope, Logger } from '@nestjs/common';
190+
import { Injectable, Scope, ConsoleLogger } from '@nestjs/common';
191191

192192
@Injectable({ scope: Scope.TRANSIENT })
193-
export class MyLogger extends Logger {
193+
export class MyLogger extends ConsoleLogger {
194194
customLog() {
195195
this.log('Please feed the cat!');
196196
}

0 commit comments

Comments
 (0)