Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix run as service introduced by and logging initialization vs configuration order #2039

Closed
wants to merge 2 commits into from

Conversation

ramonsmits
Copy link
Member

@ramonsmits ramonsmits commented Jun 3, 2020

Fixes #2031
Fixes #2002
Fixes #2017

User reported in #2031 that windows service control manager behaved strangely. Testing this indicated it was not run as a service resulting in this strange behavior. While fixing this I noticed that logging was initialized early while 'the print to console' setting was set after logging was already initialized.

… change to all instance types. Added `--portable` option to monitoring as it had no way to run as "non-interactive console".
…e early start but settings for it were initialized in Host, Commands and SetupBootstrapper having no effect in logging as logging was already initialized. Copied solution from SC instance to audit and monitoring, and also fixed that monitoring was not logging to console at all
@ramonsmits ramonsmits force-pushed the fix-run-as-service-and-logging branch from 0f74b57 to eed2028 Compare June 4, 2020 17:52
@danielmarbach
Copy link
Contributor

@ramonsmits unfortunately this probably requires a rebase now

@TraGicCode
Copy link
Contributor

Hey @ramonsmits ,

Any updates on this? is this still on the radar for your team?

Thank you!

@ramonsmits
Copy link
Member Author

Any updates on this? is this still on the radar for your team?

@TraGicCode We have reverted the behavior of the hosting and logging at the last related change broke hosting and logging. We provided a workaround to log to console by providing an NLog.config. Due to that, this specific enhancement gets a lower priority but we will eventually address it.

@TraGicCode
Copy link
Contributor

Any updates on this? is this still on the radar for your team?

@TraGicCode We have reverted the behavior of the hosting and logging at the last related change broke hosting and logging. We provided a workaround to log to console by providing an NLog.config. Due to that, this specific enhancement gets a lower priority but we will eventually address it.

Thanks for replying, I will give that a shot and see if i have any issues

@tmasternak
Copy link
Member

Hi, @TraGicCode I'm trying to figure out what is the scenario that you need the custom nlog.config. Could you share a bit more about when is it that ServiceControl doesn't log to the console and custom configuration is needed?

@TraGicCode
Copy link
Contributor

Hey @tmasternak ,

sorry for getting back to you so late. My puppet module for servicecontrol has a task that allows someone to automatically re-import failed audit and error messages. Unfortunately servicecontrol was logging but not logging to stdout which is what puppet uses to display output back to the user. @ramonsmits revommended above I needed to customize nlog for this to happen. Do you know if this is still required?

@tmasternak
Copy link
Member

Hi @TraGicCode,

In the latest version, ServiceControl logs to the console when executing an error or audit messages re-import.

@TraGicCode
Copy link
Contributor

Hey @tmasternak ,

Let me test this and get back with my results.

@TraGicCode
Copy link
Contributor

Hey @tmasternak ,

Everything appears to be working fine for me. Thanks!

@tmasternak
Copy link
Member

Glad to hear that :). Thank you for verification @TraGicCode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Strange Behavior in v4.9.0 Log to console no longer working
5 participants