You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
I am going to try and word this one a little better as my previous issue didn't fully explain the issue. If its still not relevant, then feel free to close it. Although in my opinion its needed and a really nice feature
I am overwriting the system logger with my own (using log4js and by passing logger:false to NestFactory.create), on bootstrapping the application if there are any errors then nothing is output and just an unhelpful node crash report.
This is due to the fact that I pass logger:false to NestFactory.create, which allowed me to overwrite the logger but only after the bootstrapping of NestFactory.create has finished.
Can we change it, simple passing in some kind of string to logger, so it could be a partial logger
logger: boolean | string
So logger: false, disabled the logger completely, and logger: "ONLY-ERRORS" would continue to output errors but none of the INFO, because I will be overwriting after NestFactory.create returns.
of course ONLY-ERRORS can be some kind of ENUM
enum LoggerType {
OnlyErrors = "ONLY-ERRORS"
Off = "OFF"
}
So after NestFactory.create returns then I can continue with, which would REPLACE the partial system logger for ERROR for example.
app.useLogger(app.get(SystemLogger));
The important thing here is that the system logger can work while bootstrapping so can offer ERRORS, but once we override it then that would REPLACE the Partial system logger that was enabled for producing ERROR outputs.
This would overwrite the logger function passed in above
This is due to the system bootstrapping and error out before arriving at my line to include my own custom logger i.e.
Environment
Nest version: 11
For Tooling issues:
- Node version: 6
- Platform: Mac
The text was updated successfully, but these errors were encountered:
Current behavior
I am going to try and word this one a little better as my previous issue didn't fully explain the issue. If its still not relevant, then feel free to close it. Although in my opinion its needed and a really nice feature
I am overwriting the system logger with my own (using log4js and by passing logger:false to NestFactory.create), on bootstrapping the application if there are any errors then nothing is output and just an unhelpful node crash report.
This is due to the fact that I pass logger:false to NestFactory.create, which allowed me to overwrite the logger but only after the bootstrapping of NestFactory.create has finished.
Can we change it, simple passing in some kind of string to logger, so it could be a partial logger
logger: boolean | string
So logger: false, disabled the logger completely, and logger: "ONLY-ERRORS" would continue to output errors but none of the INFO, because I will be overwriting after NestFactory.create returns.
of course ONLY-ERRORS can be some kind of ENUM
So after NestFactory.create returns then I can continue with, which would REPLACE the partial system logger for ERROR for example.
The important thing here is that the system logger can work while bootstrapping so can offer ERRORS, but once we override it then that would REPLACE the Partial system logger that was enabled for producing ERROR outputs.
This would overwrite the logger function passed in above
This is due to the system bootstrapping and error out before arriving at my line to include my own custom logger i.e.
Environment
The text was updated successfully, but these errors were encountered: