You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using Seq logging (I am using the package bunyan-seq to create a custom stream) The string interpolation / variable substitution does not work
To Reproduce
Steps to reproduce the behavior:
Include bunyan-seq package to your project along with @nest-toolbox/bunyan-logger
Setup the logging service as mentioned below in the main.ts
In the controller's create an instance of Logger from @nestjs/common
call the logger methods as described below and see the results
Expected behavior
When logging with the following statement: this.logger.warn('{user} tried access the {service} service with an expired key!',{ user: 'E73882', service: 'PurchaseOrder'});
the output in the log should be E73882 tried access the PurchaseOrder service with an expired key!
Screenshots
What happens is:
Additional context
Here is my main.ts:
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
const seq = require('bunyan-seq');
async function bootstrap() {
const app = await NestFactory.create(AppModule,{
bufferLogs: true,
});
app.useLogger(new BunyanLoggerService({
projectId: 'NestJS-Microservice',
formatterOptions: {
outputMode: 'json',
},
customStreams:[seq.createStream({serverUrl: 'http://localhost:5341', apiKey: '123456789'})] ,
extraFields: {
app: 'extra-field-app',
sample: 'extra-field-sample'
}
}));
await app.listen(3000);
}
bootstrap();`
In the controller in just create a Logger instance as follows and uses it:
`private readonly logger = new Logger('AppController');`
Examples:
`this.logger.warn('English hello {lang}',{ lang: 'en' }); `
The text was updated successfully, but these errors were encountered:
Describe the bug
When using Seq logging (I am using the package bunyan-seq to create a custom stream) The string interpolation / variable substitution does not work
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When logging with the following statement:
this.logger.warn('{user} tried access the {service} service with an expired key!',{ user: 'E73882', service: 'PurchaseOrder'});
the output in the log should be
E73882 tried access the PurchaseOrder service with an expired key!
Screenshots
What happens is:
Additional context
Here is my main.ts:
The text was updated successfully, but these errors were encountered: