[ https://issues.apache.org/jira/browse/TS-306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14682129#comment-14682129 ]
ASF GitHub Bot commented on TS-306: ----------------------------------- Github user danobi commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/274#discussion_r36772358 --- Diff: cmd/traffic_cop/traffic_cop.cc --- @@ -767,6 +767,26 @@ spawn_manager() exit(1); } + // Move any traffic.out that we can not write to, out + // of the way (TSqa2232) + // coverity[fs_check_call] + if (access(log_file, W_OK) < 0 && errno == EACCES) { + char old_log_file[PATH_NAME_MAX]; + snprintf(old_log_file, sizeof(old_log_file), "%s.old", log_file); + // coverity[toctou] + rename(log_file, old_log_file); --- End diff -- It looks like whether or not rename() fails or overwrites is implementation specific. However, BaseLogFile::open_file() also checks to see if the file can be opened, so at the very least the new code's behavior remains consistent with the current code. Therefore, I think that the potential renaming problem is outside the scope of this issue/patch. > enable log rotation for diags.log > --------------------------------- > > Key: TS-306 > URL: https://issues.apache.org/jira/browse/TS-306 > Project: Traffic Server > Issue Type: Improvement > Components: Logging > Reporter: Miles Libbey > Assignee: Daniel Xu > Labels: newbie > Fix For: 6.1.0 > > > (from yahoo bug 913896) > Original description > by Leif Hedstrom 3 years ago at 2006-12-04 12:42 > There might be reasons why this file might get filled up, e.g. libraries used > by plugins producing output on STDOUT/STDERR. A few suggestions have been > made, to somehow rotate traffic.out. One possible solution (suggested by > Ryan) is to use cronolog (http://cronolog.org/), which seems like a fine idea. > > > Comment 1 > by Joseph Rothrock 2 years ago at 2007-10-17 09:13:24 > Maybe consider rolling diags.log as well. -Feature enhancement. > > Comment 2 > by Kevin Dalley 13 months ago at 2009-03-04 15:32:18 > When traffic.out gets filled up, error.log stops filing up, even though > rotation is turned on. This is > counter-intuitive. Rotation does not control traffic.out, but a large > traffic.out will stop error.log from being > written. > -- This message was sent by Atlassian JIRA (v6.3.4#6332)