You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Brian Neradt <br...@gmail.com> on 2021/06/10 23:27:21 UTC

Design Review Request: Log Filename Specification with stderr/stdout Support

dev@trafficserver.apache.org:

There has been a request that we add the ability to redirect log output for
our various logs (manager.log, diags.log, error.log, the logging.yaml logs)
to stdout or stderr. This can be beneficial in AWS and other such
environments that have tools to monitor a process's stdout stream. I've
created a draft PR that provides this functionality here:

https://github.com/apache/trafficserver/pull/7937

This PR adds two related features:
1. The ability to specify *custom names* for diags.log, manager.log,
error.log. These are currently hard-coded to these values.
2. The ability to *log to stdout and stderr*. This uses the above naming
convention, but treats "stdout" and "stderr" as special strings that result
in logging to those streams. In addition to the above logs (diags.log,
manager.log, error.log), using these strings for the stdout and stderr
streams is also applied to logging.yaml configured logs.

This design review is an invitation to provide feedback on the API I'm
providing to specify this. As presented in the PR, the following
records.config items are added:

proxy.config.diags.logfile.filename STRING
proxy.node.config.manager_log_filename STRING
proxy.config.error.logfile.filename STRING

These correspond to the current diags.log, manager.log, and error.log
files, respectively. Their default values are the current hard-coded
filenames for these: diags.log, manager.log, and error.log. If any of these
are configured, then ATS will create filenames per their specification. For
example, consider the following configuration:

CONFIG proxy.config.diags.logfile.filename STRING my_diags.log
CONFIG proxy.node.config.manager_log_filename STRING my_manager.log
CONFIG proxy.config.error.logfile.filename STRING my_error.log

This will result in ATS creating and logging to my_diags.log,
my_manager.log, and my_error.log instead of diags.log, manager.log, and
error.log, respectively.

Further, as mentioned above, the strings "stdout" and "stderr" are treated
specially and are interpreted to indicate the stdout and stderr streams,
respectively. The logging.yaml configuration implementation is also updated
to interpret these names as the streams as well. This allows users to emit
their transaction logs to stdout by setting their "filename" node to
"stdout" or "stderr".

Please let me know if there are any concerns or feedback concerning this.

Brian
-- 
"Come to Me, all who are weary and heavy-laden, and I will
give you rest. Take My yoke upon you and learn from Me, for
I am gentle and humble in heart, and you will find rest for
your souls. For My yoke is easy and My burden is light."

    ~ Matthew 11:28-30