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

Allow to redirect logs to file or syslog or both #26

Closed
foxcpp opened this issue Apr 1, 2019 · 4 comments
Closed

Allow to redirect logs to file or syslog or both #26

foxcpp opened this issue Apr 1, 2019 · 4 comments
Assignees
Labels
new feature New feature.

Comments

@foxcpp
Copy link
Owner

foxcpp commented Apr 1, 2019

Global directive?

log <targets...>
log stderr

Write to stderr (default).

log file_name

Write to file.

log syslog

Send messages to local syslog daemon.

Can be combined:

log stderr syslog /var/log/maddy/maddy.log
@foxcpp foxcpp added the new feature New feature. label Apr 1, 2019
@foxcpp
Copy link
Owner Author

foxcpp commented Apr 1, 2019

Should we handle some signal (perhaps SIGUSR1 or SIGUSR2) as a request to reopen the log file? This will allow the logrotate daemon to not restart maddy to correctly perform the rotation.

@emersion
Copy link
Collaborator

emersion commented Apr 1, 2019

Should we handle some signal

Not a fan of this, we'll end up with more features we want than signals available. Any idea how other daemons handle this?

Maybe people who want this should use stdout + a thin wrapper process that does what you said.

@foxcpp
Copy link
Owner Author

foxcpp commented Apr 1, 2019

Not a fan of this, we'll end up with more features we want than signals available. Any idea how other daemons handle this?

Other daemons either have a full-blown IPC interface using Unix sockets or offer only one-two basic functions like "reload config" using SIGUSR1/SIGUSR2 signals.

Speaking of available signals, since Linux 2.2 we have 31 signals for application use (SIGRTMIN-SIGRTMAX, excluding two possibly used by glibc internally (let's say we use sqlite3).
Signals from this range also have some interesting properties, see signal(7)

@emersion
Copy link
Collaborator

emersion commented Apr 2, 2019

"reload config" using SIGUSR1/SIGUSR2 signals

I'm okay with that.

Speaking of available signals, since Linux 2.2 we have 31 signals for application use

This is not POSIX though.

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

No branches or pull requests

2 participants