docs.nestjs.com icon indicating copy to clipboard operation
docs.nestjs.com copied to clipboard

logger: LogLevels documentation and behavior is not clear

Open NelsonLamprecht opened this issue 5 months ago • 3 comments

The logging behavior as documented by this snippet on the logging techniques page:


const app = await NestFactory.create(AppModule, {
  logger: ['error', 'warn'],
});
await app.listen(process.env.PORT ?? 3000);

doesn't convey the observed behavior that when the logging level is set to just

['log']

you'll actually get all log,warn,error and fatal log entries.

There seems to be an inherited, cascading nature such that debug levels would include log,warn,error,fatal but that is not obviously documented that I can see.

I'd like to confirm that behavior and intent and then update the documentation.

NelsonLamprecht avatar Aug 07 '25 22:08 NelsonLamprecht

any suggestions?

micalevisk avatar Aug 07 '25 22:08 micalevisk

I'd like to confirm that behavior and intent and then update the documentation.

That's correct yes

kamilmysliwiec avatar Aug 08 '25 08:08 kamilmysliwiec

I'd like to confirm that behavior and intent and then update the documentation.

That's correct yes

Is there documentation I've missed or any other reference material I should cite to indicate that behavior? Also, I've specifically noticed that behavior with the 10.2 version of nestjs, but from the discord channel, the opinion there is nothing has changed in version 11.

NelsonLamprecht avatar Aug 08 '25 13:08 NelsonLamprecht