Add ability to disable LazyModuleLoader's logging
See original GitHub issueIs there an existing issue that is already proposing this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe it
As a serverless user, I love the ability to lazy load services!
The only thing I would change is the ability to disable the logging of each dependent service when initializing a lazy-loaded module.
See below for the default behavior:
Describe the solution you’d like
I’d leave this to the contributors, but maybe a second parameter added to the load
method would work okay, such as:
const module = await this.lazyModuleLoader.load(() => NestModuleClass, { logger: false });
return module.get(Service);
Again, 100% up to the frameworks designer for the best way to design the API
My current workaround is to extend the logger and add a list of contexts that I skip when logging an entry.
Teachability, documentation, adoption, migration strategy
Users can choose to disable/override/change the default behavior, eg. logging each dependency that gets initialized. The API above would be one way.
What is the motivation / use case for changing the behavior?
I lazy load a lot, and I’d love to see cleaner logs.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:11 (8 by maintainers)
Top Results From Across the Web
How to turn off Serilog? - Stack Overflow
Log levels can be modified at runtime with LoggingLevelSwitch : var ls = new LoggingLevelSwitch(); Log.Logger = new LoggerConfiguration() .MinimumLevel.
Read more >Enabling and Disabling Logging Messages
The following paragraphs show the commands to enable and disable logging messages, and provide examples of the resulting messages.
Read more >ADD ABILITY TO DISABLE LOGGING OF SECJ0371W ... - IBM
For instance a client continues to send an expired token repeatedly. The customer is requesting the ability to disable the logging of the...
Read more >How to Disable Console Logging in Spring Boot - Baeldung
Learn how to configure a Spring Boot application so that it does not log to the console, whether it is using Logback, Log4j2, ......
Read more >Solved: Can we disable logging levels display for a partic...
Do you think this is a common problem that requires a new feature in Bamboo? I'm asking this one because I was not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
“interface 1” option would be great to have @micalevisk!
So let’s just implement the disabling part for the time being. I can’t think of a use case where using a separate logger class (specifically for lazy-loaded modules) would make sense anyway.