The config service
The winston instance that will be used inside the service
Exposes a writable stream for http messages that can be used by morgan for generating apache-style logs.
Log errors thrown in the application. For compatibility with Nest, this method can accept a stack trace as the second argument, and a label as its third. Will also accept an Error as the first argument, and will print the stack trace separately. LOG LEVEL: 0
Records all requests/responses handled by the application, similar to Apache/nginx logs LOG LEVEL: 3
The standard log level, used to for relaying regular information about the status of the app, e.g. Nest startup messages LOG LEVEL: 2
Helper function that wraps util.inspect and passes in our defined options
The base logging function used by Nest and TypeORM. They use different formats, so if the first arugment is one of TypeORM's log levels it will expect the log message to be the second argument. Otherwise, the first argument will be treated as the log message, and the second argument as the nest component generating the message. In our implementaiton, log/info messages will go to the info stream, and warnings will go to the warn stream
Define a custom log format: TIMESTAMP [LEVEL] (LABEL) MESSAGE
Logs messages from the TypeORM migration process. Will write a notification to our verbose stream Will log the full migration message to our debug stream
Logs every query run by TypeORM, with parameters Will write a notification to the verbose stream Will write the query and parameters to the debug stream
Handles logging query errors generated by TypeORM by passing them to our error function
Method used by TypeORM to flag long-running queries that could indicate
performance issues.
The threshold for slow queries is set by the maxQueryExecutionTime
in the connection options in app.module.ts
Messages will be passed to our warn function
Logs messages from the TypeORM schema building process. Will write a notification to our verbose stream Will log the full schema build message to our debug stream
Records more detailed information about the running application. Includes:
This method will expand objects/arrays passed as arguments, such as:
Record issues that don't degrade the application, but may produce less-desirable results. LOG LEVEL: 1
Generated using TypeDoc
An injectable service that instantiates a Winston logger, and overwrites the existing Nest logging methods with Winston's methods.