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

Is service logger compatible with default log #162

Open
eduardhasanaj opened this issue Jan 14, 2019 · 1 comment
Open

Is service logger compatible with default log #162

eduardhasanaj opened this issue Jan 14, 2019 · 1 comment

Comments

@eduardhasanaj
Copy link

When coding I use mostly go default log. Is there any way to pass logs to service logger

@prochac
Copy link

prochac commented Jan 9, 2023

Almost ...
kardianos/service uses *(log/syslog).Writer under the hood.
Or *(golang.org/x/sys/windows/svc/eventlog).Log in case of Windows.

On 'linux-systemd' or 'darwin-launchd', I get stderr being scraped by service managers, but it can be considered luck, not cross-platform solution.

By some hackish approach it can be done, but the result won't be IMO satisfying.
All logs will be logged on the same level, if so.
https://go.dev/play/p/fTfDw1bQg89

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

No branches or pull requests

2 participants