Logging
For development purposes it might come handy to enable logging and debug mode:
By doing this MikroORM
will start using console.log()
function to dump all queries:
It is also useful for debugging problems with entity discovery, as you will see information about every processed entity:
#
Custom LoggerYou can also provide your own logger via logger
option.
#
Logger NamespacesThere are multiple Logger Namespaces that you can specifically request, while omitting the rest.
Just specify array of them via the debug
option:
Currently, there are 4 namespaces – query
, query-params
, discovery
and info
.
If you provide query-params
then you must also provide query
in order for it to take effect.
#
HighlightersPreviously Highlight.js was used to highlight various things in the CLI, like SQL and mongo queries, or migrations or entities generated via CLI. While the library worked fine, it was causing performance issues mainly for those bundling via webpack and using lambdas, as the library was huge.
In v4 highlighting is disabled by default, and there are 2 highlighters you can optionally use (you need to install them first).
For MongoDB you can use MongoHighlighter
from @mikro-orm/mongo-highlighter
package.