How to update default config in production environment at run time
See original GitHub issueRelated issue #7 answers how to change the logging config at compile-time (using environment), but I wish to know how to change the global config at run-time.
The logger.updateConfig(config)
method only changes them for the current instance.
I am trying to perform this update in an APP_INITIALIZER
of the Angular bootstrap, but it grabs a new copy of the config provided in forRoot(config).
I wondering if the service could have another way to update the default config which is always provided to the service when initialized:
// each instance of the logger should have their own config engine
this.configService = new NgxLoggerConfigEngine(loggerConfig);
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Production Configuration - 2.8.x - Play Framework
conf overrides the default settings in the various reference.conf files. You can override runtime configuration in several ways. This can be handy when...
Read more >Use multiple environments in ASP.NET Core | Microsoft Learn
Select the app from the App Services page. · In the Settings group, select Configuration. · In the Application settings tab, select New ......
Read more >Should default configuration for deployed services be set as ...
For those options, your default should be to set the production settings. These options are things like sidestepping caches, or enabling debug ...
Read more >changing or updating app.config at runtime in wpf projects
I have four config files for DEV, TEST, UAT, PROD. Based on user selection I need to overwrite the default config file completely...
Read more >How to Configure .Net Core, ASP.NET Environments With ...
Therefore, it is crucial to check and update your environment configuration ... Now, how can we retrieve the configuration value at runtime?
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 FreeTop 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
Top GitHub Comments
@dbfannin this would also be useful in our app
The user story is a bit different : We need to change the logLevel at runtime (by default in PROD mode it’s set to ERROR) but if we need to investigate on an issue, we’d like to modify that logLevel to DEBUG or TRACE for example.
So the updateConfig should update all “living” instances of NGXLogger AND the future instances.
Are you open to PR for this ? and if so I was thinking of doing something like this :
So one workaround might be to read the logLevel from localStorage and then you can update the value in the browser console at runtime. This is how the nodejs
debug
module works.example
app.module.ts