-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
Currently, there are a number of workarounds in the code base to handle the fact that logging needs to occur before the -SettingFile argument is parsed.
See:
- Logging is initialized before the configuration file is processed. #6085 - Logging is initialized before the configuration file is processed
- Make sure that SettingFile arg is parsed before we load the settings #7449 - Make sure that -SettingFile arg is parsed before we load the settings
While these changes workaround specific issues, we still have areas where logging settings are ignored due to logging before the logging settings in the setting file is parsed. PR 7449 presents a possible fix by parsing the -SettingFile argument earlier in command-line parsing. This change would move this logic to moving this logic to UnmanagedPSEntry.Start and avoid any further issues.
The call should be placed immediately before PSEtwLog.LogConsoleStartup(), the call should then be unconditional, and the conditional call in ConsoleHost can be removed.
Also revisit the SetSnapInLoggingInformation(coreMshSnapin) in PSSnapInReader.ReadCoreEngineSnapIn which is currently disabled on UNIX due to this issue.