logging: true
in your connection options:error
:query
- logs all queries.error
- logs all failed queries and errors.schema
- logs the schema build process.warn
- logs internal orm warnings.info
- logs internal orm informative messages.log
- logs internal orm log messages.logging: "all"
:maxQueryExecutionTime
in connection options:1 second
.advanced-console
- this is the default logger which logs all messages into the console using color and sql syntax highlighting (using chalk).simple-console
- this is a simple console logger which is exactly the same as the advanced logger, but it does not use any color highlighting. This logger can be used if you have problems / or don't like colorized logs.file
- this logger writes all logs into ormlogs.log
in the root folder of your project (near package.json
and ormconfig.json
).debug
- this logger uses debug package, to turn on logging set your env variable DEBUG=typeorm:*
(note logging option has no effect on this logger).Logger
interface:ormconfig
file, then you can use it and override it in the following way:QueryRunner
when it's available. It's helpful if you want to log additional data. Also, via query runner, you can get access to additional data passed during persist/remove. For example: