Nest: [Question] Turning off log messages when an application starts ?

Created on 2 Feb 2018  路  7Comments  路  Source: nestjs/nest

I hope there's some kind of environment variable that does the thing.
Here's the output I'd like to get rid of when doing e2e testing:

[Nest] 99271 - 2018-2-4 01:41:48 [NestFactory] Starting Nest application... [Nest] 99271 - 2018-2-4 01:41:48 [InstanceLoader] ApplicationModule dependencies initialized +17ms [Nest] 99271 - 2018-2-4 01:41:48 [InstanceLoader] SystemModule dependencies initialized +3ms [Nest] 99271 - 2018-2-4 01:41:48 [InstanceLoader] EnvironmentModule dependencies initialized +1ms [Nest] 99271 - 2018-2-4 01:41:48 [InstanceLoader] LoggerModule dependencies initialized +3ms [Nest] 99271 - 2018-2-4 01:41:48 [InstanceLoader] NodeModule dependencies initialized +1ms [Nest] 99271 - 2018-2-4 01:41:48 [InstanceLoader] BlockchainModule dependencies initialized +3ms

Thanks

Most helpful comment

Hi @thohoh,
For now you can use a workaround:

Logger.setMode(NestEnvironment.TEST);

All 7 comments

Can you share code or other details, and follow the issue template so we can help diagnose your issue?

@wbhob I apologise, right after I posted this question I actually edited it and made more informative, but it backed up to the first state for some reason.

hmmm as far as I know, there's no way to disable logging. There are a number of other issues that have expressed interest in manipulating/disabling the logger. This would be a good question to put on the survey @kamilmysliwiec . Otherwise, I don't think you can do this.

Hi @thohoh,
For now you can use a workaround:

Logger.setMode(NestEnvironment.TEST);

@kamilmysliwiec any progress on this?

@chanlito yes, now we have a possibility to create custom Logger, then you're able to handle it by your own.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KamGor picture KamGor  路  3Comments

artaommahe picture artaommahe  路  3Comments

2233322 picture 2233322  路  3Comments

cdiaz picture cdiaz  路  3Comments

rafal-rudnicki picture rafal-rudnicki  路  3Comments