[
https://issues.apache.org/jira/browse/TS-306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14682083#comment-14682083
]
ASF GitHub Bot commented on TS-306:
-----------------------------------
Github user SolidWallOfCode commented on a diff in the pull request:
https://github.com/apache/trafficserver/pull/274#discussion_r36769922
--- Diff: iocore/eventsystem/test_Event.cc ---
@@ -91,23 +91,13 @@ reconfigure_diags()
static void
init_diags(const char *bdt, const char *bat)
{
- FILE *diags_log_fp;
char diags_logpath[500];
strcpy(diags_logpath, DIAGS_LOG_FILE);
- diags_log_fp = fopen(diags_logpath, "w");
- if (diags_log_fp) {
- int status;
- status = setvbuf(diags_log_fp, NULL, _IOLBF, 512);
- if (status != 0) {
- fclose(diags_log_fp);
- diags_log_fp = NULL;
- }
- }
-
- diags = new Diags(bdt, bat, diags_log_fp);
+ BaseLogFile *blf = new BaseLogFile(diags_logpath);
+ diags = new Diags(bdt, bat, blf);
- if (diags_log_fp == NULL) {
+ if (blf && blf->m_fp == NULL) {
--- End diff --
How can `blf` be `NULL` since you just allocated it? And in that case the
condition should be `NULL == blf || NULL == blf->m_fp` because if `blf` is NULL
you're failed as well.
> 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)