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
How do I make envoy log to the systemd journal other than using /dev/stdout? #8297
Comments
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions. |
Did you manage to figure out how to do this? I'm also looking into it. |
When a systemd unit starts your process, it sets your process's file descriptor 1 (i.e. stdout) to an open Unix domain socket. You can observe this if you were to do this within your systemd unit:
You should see something like this:
This shows that This behavior is actually documented in the
When your envoy config has
To work around this (Linux) limitation, you could change your unit like so:
That would make envoy's Alternatively (to using |
My feeling is that this problem is still not properly resolved as it requires running envoy under bash. Since the issue was opened there have been some changes in the access logging configuration of envoy by introducing explicit envoy.access_loggers.stdout and envoy.access_loggers.stderr loggers. As far as I understand, they were trying to solve the problem of printing logs to stdout and stderr under windows (#13964). I was hoping that they will also solve the current problem but they haven't because the posix implementation still tries to open /dev/stdout and /dev/stderr which are missing under systemd and I am still getting the error:
My question is can't the posix implementation of stdout and stderr loggers also open directly fd 1 and 2 as the windows implementation and wouldn't that finally fix the problem? I am also not sure if I should open a new issue (which essentially is the same problem as described here) or keep discussing it here. |
@dio (sorry, not sure who else to ping) |
|
Description:
I'm trying to make Envoy output access logs to my Systemd Journal rather than to a file.
Following #1291 i tried setting
envoy.http_connection_manager.access_log.config.path
to/dev/stdout
.This works when I manually run Envoy using
/usr/bin/envoy --config-path /etc/envoy/config.yaml
, but fails when started throughsystemctl
with error:Turns out that
stdout
is a symlink on my system:I tried setting
/dev/pts/1
aspath
, but that outputs the logs to my current console rather than to the systemd journal.As such, how do I get Envoy to output logs to my journal rather than to a file, if
/dev/stdout
is not usable?Version info:
Manually compiled from source, running on Gentoo with Systemd, kernel 4.19.72 (so not in Docker).
Systemd unit:
The text was updated successfully, but these errors were encountered: