I want to migrate from Apache to OLS in my Kubernetes cluster. I cannot find a reasonable way to send the logs (especially the application error logs) to stdout and stderr.
Here are the things I have tried:
-
Sending the logs to /dev/stdout and /dev/stderr:
The /dev/stdout and /dev/stderr file descriptors are normally symlinks to /proc/self/fd/0 and /proc/self/fd/1, but OLS overwrites those symlinks with regular files.
-
Sending the logs to simply stdout and stderr:
This just creates files named stdout and stderr in the lsws or vhost folder.
-
Sending the logs to /proc/self/fd/0 and /proc/self/fd/1:
I think in this case the logs just evaporate. Nothing in my terminal, and no logfiles that I could find.
-
Before starting OLS, create a symlink with the same name as the logfile.
In this case, OLS overwrites the symlink with a regular file, exactly the same as setting the log file to /dev/stdout.
-
I also tried running OLS in the foreground (The default dockerfile has an infinite status loop and service monitor, which should instead be handled by the service orchestrator kubernetes or whatever), but logs were still not sent to stdout.
How are people handling logging in docker/kubernetes?
I want to migrate from Apache to OLS in my Kubernetes cluster. I cannot find a reasonable way to send the logs (especially the application error logs) to stdout and stderr.
Here are the things I have tried:
Sending the logs to
/dev/stdoutand/dev/stderr:The
/dev/stdoutand/dev/stderrfile descriptors are normally symlinks to/proc/self/fd/0and/proc/self/fd/1, but OLS overwrites those symlinks with regular files.Sending the logs to simply
stdoutandstderr:This just creates files named
stdoutandstderrin the lsws or vhost folder.Sending the logs to
/proc/self/fd/0and/proc/self/fd/1:I think in this case the logs just evaporate. Nothing in my terminal, and no logfiles that I could find.
Before starting OLS, create a symlink with the same name as the logfile.
In this case, OLS overwrites the symlink with a regular file, exactly the same as setting the log file to
/dev/stdout.I also tried running OLS in the foreground (The default dockerfile has an infinite status loop and service monitor, which should instead be handled by the service orchestrator kubernetes or whatever), but logs were still not sent to stdout.
How are people handling logging in docker/kubernetes?