Questions tagged [nest-winston]
13 questions
3
votes
3 answers
NestJS: How to customise log messages to include request id and name of the file the log message occurred
I am new to NestJS and would like to customise the log messages to include the x-request-id/x-correlation-id and the name of the file the log message originated but am not sure if there is anything in NestJS to do that.
My application is using…

mh377
- 1,656
- 5
- 22
- 41
1
vote
1 answer
How to mock a nest-winston logger dependency in nestjs unit tests
This question already exists, but it is marked as solved and the solution doesn't work at all for me.
I want to mock a nest-winston logger that is a dependency of a provider in nestjs.
@Controller('builder/instance')
export class InstanceController…

Tomer Trashman
- 31
- 4
1
vote
1 answer
How to get a classname along with logs in NestJS using Winston logger
I am using NestJS as a backend service in which I want to add some logger for better logging mechanism.Though NestJs has a default logger for logging but I am using Winston in my application.
I want functionality so I can get a class name also in…

Digvijay
- 2,887
- 3
- 36
- 86
0
votes
1 answer
Error " Type 'WinstonAzureBlob' is missing the following properties from type 'TransportStream': writable, ...." when using winston-azure-blob lib
I am trying to upload my logs in the azure storage. I used the winstonAzureBlob library. But I am getting this error
'TS2740: Type 'WinstonAzureBlob' is missing the following properties from type 'TransportStream': writable, writableEnded,…

user17795484
- 23
- 3
0
votes
1 answer
Grafana always requests /api/live/ws on NestJS Backend
I set up Grafana and Grafana Loki with my NestJS Backend, which works totally fine. I can get my logs in Grafana. But i also recognized that my NestJS throws a 404 error because the /api/live/ws route is requestet by Grafana.
Is it possible to…

maxi hraschan
- 153
- 12
0
votes
0 answers
Unable to resolve signature of WINSTON_MODULE_PROVIDER parameter decorator when called as an expression
Context
I have been working on this project for almost a year now, with no issue injecting Winston logger Logger with the WINSTON_MODULE_PROVIDER token. I woke up last week to find that TypeScript now highlights this piece of code…

Tobi Akanji
- 45
- 4
0
votes
1 answer
nestjs global inject nestwinston and format
I'm trying to inject nestwinston globally in my nestjs app and also to keep a beautiful format in my console/terminal and in Grafana, and most important to display custom objects where needed, but using a beautiful format, not simply JSON.
My…

johnykes
- 1,663
- 2
- 9
- 25
0
votes
0 answers
Map available fields in logs to Elastic Common Schema format in NodeJS
I'm trying to log all my requests, responses and application logs in the ECS Format - https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html
Reading their guides I'm using morgan as my logger and I get the following format out of the…

Gowtham Munukutla
- 45
- 1
- 6
0
votes
0 answers
How does nest-winston get rid of escaping quotes when building JSON.stringify()?
How does nest-winston get rid of escaping quotes when building JSON.stringify()?
winston.config.ts:
errors: {
level: 'error',
// filename: "./logs/errors.log",
filename: pathErrors,
handleRejections: true,
handleExceptions:…

Illusion
- 71
- 9
0
votes
3 answers
Unable to use Winston Logger globally in all modules - NestJS
I'm new to NestJS and don't understand it completely. Any help is appreciated.
I'm trying to configure Winston logger globally so I can use it in all modules without the need to import it for every module.
// main.ts
import { WinstonModule } from…

Ayesha
- 1
- 1
- 1
0
votes
1 answer
How to remove unwanted character from log files created by Winston
I am using Winston logger inside NestJS application but when logs are writing in file then some unwanted characters are also get appended to my logs.
Below are the logs from log file:
[92m[MyApp][39m [33mInfo[39m 16/3/2022, 7:03:52 pm…

Digvijay
- 2,887
- 3
- 36
- 86
0
votes
0 answers
how to use winston logger in nest node in static classes
I want to use winston logging module in my node application and I am using nest framework.
So I installed
yarn add nest-winston
yarn add winston
and in my app.module.ts
WinstonModule.forRoot({
format: winston.format.combine(
…

Sunil Garg
- 14,608
- 25
- 132
- 189
0
votes
0 answers
Configure multiple winston loggers in Nestjs
I am working on an application where I have to use Winston for logging purposes in Nest.js. I want to implement a scenario where I want to specify the transport on which I want to log the message.
For example, I have two transporters like console…

Muhammad Zeeshan
- 4,608
- 4
- 15
- 41