[
https://issues.apache.org/jira/browse/RANGER-3632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17494880#comment-17494880
]
kirby zhou commented on RANGER-3632:
------------------------------------
Additionally 1
the default value of ACCESS_LOG_PREFIX and ACCESS_LOG_DATE_FORMAT is not a good
idea
{code:java}
valve.setPrefix(EmbeddedServerUtil.getConfig(ACCESS_LOG_PREFIX,"access-" +
hostName + "-"));
valve.setFileDateFormat(EmbeddedServerUtil.getConfig(ACCESS_LOG_DATE_FORMAT,
"yyyy-MM-dd.HH")); {code}
if we set ACCESS_LOG_DATE_FORMAT to "", we get a final filename as
"access-localhost-" which looks so ugly.
The good idea which tomcat is taken looks like:
{code:java}
valve.setPrefix(EmbeddedServerUtil.getConfig(ACCESS_LOG_PREFIX,"access-" +
hostName));
valve.setFileDateFormat(EmbeddedServerUtil.getConfig(ACCESS_LOG_DATE_FORMAT,
"-yyyy-MM-dd.HH")); {code}
Additionally 2
I do not know the reason why we include hostName in default ACCESS_LOG_PREFIX.
Apache httpd and nginx both set default access_log as a fixed filename.
> Add a option to fix the filename of current access-log
> ------------------------------------------------------
>
> Key: RANGER-3632
> URL: https://issues.apache.org/jira/browse/RANGER-3632
> Project: Ranger
> Issue Type: Improvement
> Components: admin, kms
> Affects Versions: 3.0.0, 2.3.0
> Reporter: kirby zhou
> Priority: Major
>
> Currently, the filename of the access-log in use has a timestamp as the
> suffix. This brings trouble to some log monitoring and analysis programs,
> such as "tail -f access-log"
> Need to add an option to enable tomcat's RenameOnRotate capability to fix the
> file name of access-log.
>
> {code:java}
> // in EmbeddedServer::start()
> valve.setRenameOnRotate(
> EmbeddedServerUtil.getConfig(ACCESS_LOG_RENAME_ON_ROTATE, false);
> );{code}
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)