#Custom log levels

12 messages · Page 1 of 1 (latest)

uncut socket
#

Is it possible to add log levels to the logger? And can custom loggers use more log levels than the logger?

gray horizon
#

I believe this is outlined in the docs if you search for Logger

uncut socket
#

Not exactly, because the Logger service has only a fixed amount of log levels

#

So if I want to add something like silly that does not fit

gray horizon
#

Yeah, you can't use the NestJS logger interface, but you can extend it and use that

uncut socket
#

And how do I extend it?

#

Or do you mean extending the class?

#

And what is the correct logger to extend? Logger or ConsoleLogger?

#

Also, setLogLevels expects only a subset of the predefined log levels

#

Or how would I extend that in super?

#

Maybe the Log levels type should also be an interface to it could be augmented?

gray horizon