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

Custom proxy.config.output.logfile has no effect #6249

Closed
xeron opened this issue Dec 10, 2019 · 4 comments · Fixed by #8013
Closed

Custom proxy.config.output.logfile has no effect #6249

xeron opened this issue Dec 10, 2019 · 4 comments · Fixed by #8013

Comments

@xeron
Copy link

xeron commented Dec 10, 2019

trafficserver version: 8.0.5.
OS: Amazon Linux v1 (CentOS 6 based)

Related config parts:

CONFIG proxy.config.log.logfile_dir STRING /mnt/logs/trafficserver
CONFIG proxy.config.output.logfile STRING /mnt/logs/trafficserver/traffic.out

Actual files:

# ls -l /mnt/logs/trafficserver/
total 56
-rw-r--r-- 1 ats ats  6522 Dec 10 08:44 access.log
-rw-r--r-- 1 ats ats 19891 Dec 10 09:04 diags.log
-rw-r--r-- 1 ats ats 21905 Dec 10 09:04 manager.log

# ls -l /opt/trafficserver/var/log/trafficserver/
total 8
-rw-r--r-- 1 root root 5844 Dec 10 09:04 traffic.out
@xeron
Copy link
Author

xeron commented Dec 12, 2019

Other issues I noticed which are kind of related:

  • The following options have no effect on traffic.out:
CONFIG proxy.config.output.logfile.rolling_enabled INT 3
CONFIG proxy.config.output.logfile.rolling_interval_sec INT 86400
CONFIG proxy.config.output.logfile.rolling_size_mb INT 1000

@xeron
Copy link
Author

xeron commented Dec 13, 2019

Just found that default init script sets --bind_stdout and --bind_stderr on redhat… could be the reason I guess?

Related PR: #3894

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. Marking it stale to flag it for further consideration by the community.

@github-actions github-actions bot added the Stale label Jun 28, 2021
@bneradt
Copy link
Contributor

bneradt commented Jun 29, 2021

Yes, I happened to just come across this code while working on #7937. Our documentation is a bit misleading about proxy.config.output.logfile. It currently, it says:

https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.config.en.html?highlight=proxy.config.output.logfile#proxy.config.output.logfile

The name and location of the file that contains warnings, status messages, and error messages produced by the Traffic Server processes. If no path is specified, then Traffic Server creates the file in its logging directory.

This is mostly true, in a very literal sense. But most readers will read this as implying that this becomes the name of the file that gets created by the ATS process for stdout/stderr logs. In fact, this is not how this configuration works. The name of the stdout/stderr file is set, as you observed, via --bind_stdout and --bind_stderr arguments to the process. The proxy.config.output.logfile isn't used to set the name of the file, but to configure ATS concerning what the file was named via these command line parameters for the purpose of log rotation. If you configure proxy.config.output.logfile differently than --bind_stdout and --bind_stderr then log rotation of that file will not work.

Thus, to restate this:

  • The name of the file ATS creates and writes to for process output is set via --bind_stdout and --bind_stderr command line parameters.
  • If you want that output file to be rotated by the ATS process, you have to separately tell ATS what the name of the file you set on the command line with --bind_stdout and --bind_stderr via the proxy.config.output.logfile records.config parameter.

I'll update the docs to make this clearer.

bneradt added a commit to bneradt/trafficserver that referenced this issue Jun 29, 2021
The traffic_manager and traffic_server stdout and stderr streams can be
bound via the --bind_stdout and --bind_stderr command line options. If
this is done, then `proxy.config.output.logfile` can be used to identify
that path for log rolling. This change clarifies that the latter
configuration is only for log rolling configuration identification
purposes and that the filename that ATS uses is actually set via the
--bind options.

---

This fixes: apache#6249
bneradt added a commit that referenced this issue Jun 29, 2021
The traffic_manager and traffic_server stdout and stderr streams can be
bound via the --bind_stdout and --bind_stderr command line options. If
this is done, then `proxy.config.output.logfile` can be used to identify
that path for log rolling. This change clarifies that the latter
configuration is only for log rolling configuration identification
purposes and that the filename that ATS uses is actually set via the
--bind options.

---

This fixes: #6249
zwoop pushed a commit that referenced this issue Jul 13, 2021
The traffic_manager and traffic_server stdout and stderr streams can be
bound via the --bind_stdout and --bind_stderr command line options. If
this is done, then `proxy.config.output.logfile` can be used to identify
that path for log rolling. This change clarifies that the latter
configuration is only for log rolling configuration identification
purposes and that the filename that ATS uses is actually set via the
--bind options.

---

This fixes: #6249

(cherry picked from commit 534c8b3)
zwoop pushed a commit that referenced this issue Jul 13, 2021
The traffic_manager and traffic_server stdout and stderr streams can be
bound via the --bind_stdout and --bind_stderr command line options. If
this is done, then `proxy.config.output.logfile` can be used to identify
that path for log rolling. This change clarifies that the latter
configuration is only for log rolling configuration identification
purposes and that the filename that ATS uses is actually set via the
--bind options.

---

This fixes: #6249

(cherry picked from commit 534c8b3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants