Contribute to help us improve!
Are there edge cases or problems that we didn't consider? Is there a technical pitfall that we should add? Did we miss a comma in a sentence?
If you have any input for us, we would love to hear from you and appreciate every contribution. Our goal is to learn from projects for projects such that nobody has to reinvent the wheel.
Let's collect our experiences together to make room to explore the novel!
To contribute click on Contribute to this page on the toolbar.
Logger
When you create a new devon4node application, it already has a logger: src/app/shared/logger/winston.logger.ts
. This logger provide the methods log
, error
and warn
. All of those methods will write a log message, but with a different log level.
The winston logger has two transports: one to log everything inside the file logs/general.log and the other to log only the error logs inside the file logs/error.log. In addition, it uses the default NestJS logger in order to show the logs in the console.
As you can see it is a simple example about how to use logger in a devon4node application. It will be update to a complex one in the next versions.
How to use logger
In order to use the logger you only need to inject the logger as a dependency:
constructor(logger: WinstonLogger){}
and then use it
async getAll() {
this.service.getAll();
this.logger.log('Returning all data');
}