-
Notifications
You must be signed in to change notification settings - Fork 782
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
Log-to-file / logging on Windows with SC.exe #1416
Comments
They @itdaniher, thanks for taking the time to submit a ticket. What do applications typically do for logging on Windows? Is it typical to provide something like a '-log-file /path/to/log` style option, either as a command line argument or a config option? What would you like to see? I'm sure I can look this up but I'm mainly interested in what you want, a real use case. Thanks. |
I'd love to see Thanks! |
Hi @eikenb . I think it will be really useful as we can run consul-template as windows service since 0.26.0 #1382, but we are blind due to no logs we can get. https://www.consul.io/docs/agent/options#_log_file, such as |
- Consul-like CLI flags used to control the behaviour of the feature - `log_file` configuration stanza - updated docs for CLI and config Fixes hashicorp#1416 Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
Hi there 👋 I just created #1534. It should address this issue by adding I also dared to write the relevant documentation. I hope that's OK. Cheers! |
As an alternative, some Windows magic can redirect standard output to a file. So creating the service like this will do it (capturing both standard out, 1, and errors, 2, in the same file).
|
Consul Template version
v0.25.1
Expected behavior
Consul-template supports logging to file. Consul-template can be started as a service on Windows, and the resultant messages can be inspected. Consul offers
-log-file
via stdarg and Nomad offerslog_file
in the config.Actual behavior
Consul-template only supports Syslog and stdout/stderr logging mechanisms. Windows discards stdout/stderr messages from services. Seemingly no way to get persistent logging without wrapping consul-template.exe in a script that captures stdout and stderr to a file.
Steps to reproduce
References
Are there any other GitHub issues (open or closed) that should
be linked here? For example:
The text was updated successfully, but these errors were encountered: