diff options
author | Andrew Clayton <a.clayton@nginx.com> | 2023-03-30 05:53:13 +0100 |
---|---|---|
committer | Andrew Clayton <a.clayton@nginx.com> | 2023-04-11 19:08:32 +0100 |
commit | 45c45eaeb4443ff4af9cc49e716bbd9d65596b02 (patch) | |
tree | 1ca6fd50b5a7e3dfce5c90ddd30d5e73316c43f4 /pkg | |
parent | 8b8952930c8462b5c56cdaf14e4a1c7c8b0c203d (diff) | |
download | unit-45c45eaeb4443ff4af9cc49e716bbd9d65596b02.tar.gz unit-45c45eaeb4443ff4af9cc49e716bbd9d65596b02.tar.bz2 |
Add per-application logging.
Currently when running in the foreground, unit application processes
will send stdout to the current TTY and stderr to the unit log file.
That behaviour won't change.
When running as a daemon, unit application processes will send stdout to
/dev/null and stderr to the unit log file.
This commit allows to alter the latter case of unit running as a daemon,
by allowing applications to redirect stdout and/or stderr to specific
log files. This is done via two new application options, 'stdout' &
'stderr', e.g
"applications": {
"myapp": {
...
"stdout": "/path/to/log/unit/app/stdout.log",
"stderr": "/path/to/log/unit/app/stderr.log"
}
}
These log files are created by the application processes themselves and
thus the log directories need to be writable by the user (and or group)
of the application processes.
E.g
$ sudo mkdir -p /path/to/log/unit/app
$ sudo chown APP_USER /path/to/log/unit/app
These need to be setup before starting unit with the above config.
Currently these log files do not participate in log-file rotation
(SIGUSR1), that may change in a future commit. In the meantime these
logs can be rotated using the traditional copy/truncate method.
NOTE:
You may or may not see stuff printed to stdout as stdout was
traditionally used by CGI applications to communicate with the
webserver.
Closes: <https://github.com/nginx/unit/issues/197>
Closes: <https://github.com/nginx/unit/issues/846>
Reviewed-by: Alejandro Colomar <alx@nginx.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'pkg')
0 files changed, 0 insertions, 0 deletions