-
Notifications
You must be signed in to change notification settings - Fork 31
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
Where should we store logs by default? #71
Comments
I think what you're saying is fine, but I'm not sure what changes we would need to make to the code in this repo. Is there a specific change you want made to the alpaca binary itself? Or are you talking about the launchd agent (or systemd unit, or other startup script) that launches it? This code in this repo just starts a proxy server process and writes some output to stdout/err. It's really up to the packager (e.g. for the homebrew formula, rpm/deb package) to decide how to daemonise that process, and capture (and possibly rotate) the logs. This needs to be left to the packagers because a lot of the conventions are platform-specific. For macOS, there's a launchd agent in the homebrew formula. I don't know much about launchd and when I originally wrote the formula I wasn't able to figure out how to get launchd to expand variables like |
Based on github.com/Homebrew/brew/…/service_spec.rb, perhaps you could log to |
I've updated the homebrew formula so that it sends logs to var/log/alpaca.log, under the homebrew prefix. So on my Macbook, this is /opt/homebrew/var/log/alpaca.log. It's up to other package maintainers to decide how they want to configure the log file location, but this is the default for homebrew users. |
Working out the best place to store logs is complicated.
If the user is running the program, from the console, I suspect that the right place is stdout / stderr (as appropriate).
If, however, they are running it in a "detached" (background, daemon) mode with no associated console (or via some agent), a more reasonable default would seem to be
$XDG_STATE_HOME
(see: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html).The text was updated successfully, but these errors were encountered: