Fix logs still appearing even when LogLevel is set to none bug#3318
Fix logs still appearing even when LogLevel is set to none bug#3318RubenCerna2079 wants to merge 32 commits intomainfrom
none bug#3318Conversation
|
/azp run |
|
/azp run |
|
/azp run |
none bug
I do not understand this. |
|
If we use different LogBuffers for different classes, wouldn't the logs get out of place as we will be flushing the log buffers in a different order of collecting the logs. |
Aniruddh25
left a comment
There was a problem hiding this comment.
Why does the description say we want to fix logs only from dab start? Why not the other commands?
…loglevel-bugs' into dev/rubencerna/fix-loglevel-bugs
Why make this change?
Closes issue [Bug]: Startup class logger is not properly initialized #3262
The logger for the Startup class is not initialized properly, since this logger is special due to the nature of the Startup class it needs to be continuously updated as DAB initializes. This causes two problems:
Closes issue [Bug]: CLI logs being outputed even after LogLevel is set to none #3256 & [Bug]:
log-levelseems like it is not working when two in config. #3255The CLI logger still outputs some logs even when the LogLevel is set to
none. It is expected that if the LogLevel set isnoneor some other level that shouldn't output theinformationlevel, the logs will not appear.What is this change?
Important Note: These changes currently only allow us to change the LogLevel from the CLI with the
defaultnamespace in the config file. An task was created to solve this issue: #3451In order to solve issue #3262:
Startup.cs, this is necessary since we wanted each class to have its own LogBuffer so that we are able to tell from which logger the logs are being outputted.Startuplogger by changing the method that it was using to initialize the logger, it now usesCreateLoggerFactoryForHostedAndNonHostedScenariowhich checks if there are any LogLevel namespaces from the config file that can be applicable for the specific logger. It is important to note that there are multiple places where the logs are flushed in order to cover for the cases in which an exception is found and causes DAB to end abruptly, and when we there is an IsLateConfigured scenario.In order to solve issue #3256 & #3255:
StartOptions.csuntil it is able to deserialize the RuntimeConfig and find which level to set theLogLevelin order to flush all the logs.dab startcommand, which is why we only make this change in theStartOptions.csfile, on the functionTryStartEngineWithOptionsinside ofConfigGenerator.cs, and a few functions fromUtils.csandConfigMerger.csthat are used inside theTryStartEnginefunction.How was this tested?
Sample Request(s)