--- asterisk-1.8.13.0.o/configs/logger.conf.sample 2010-07-26 21:51:39.000000000 +0200 +++ asterisk-1.8.13.0/configs/logger.conf.sample 2012-08-02 15:07:39.231637613 +0200 @@ -35,6 +35,9 @@ ;queue_log_name = queue_log ; ; Log rotation strategy: +; none: Do not perform any logrotation at all. You should make +; very sure to set up some external logrotate mechanism +; as the asterisk logs can get very large, very quickly. ; sequential: Rename archived logs in order, such that the newest ; has the highest sequence number [default]. When ; exec_after_rotate is set, ${filename} will specify --- asterisk-1.8.13.0.o/main/logger.c 2012-04-30 17:51:12.000000000 +0200 +++ asterisk-1.8.13.0/main/logger.c 2012-08-02 15:42:31.889235766 +0200 @@ -82,6 +82,7 @@ static int logger_initialized; static enum rotatestrategy { + NONE = 0, /* Do not rotate log files at all, instead rely on external mechanisms */ SEQUENTIAL = 1 << 0, /* Original method - create a new file, in order */ ROTATE = 1 << 1, /* Rotate all files, such that the oldest file has the highest suffix */ TIMESTAMP = 1 << 2, /* Append the epoch timestamp onto the end of the archived file */ @@ -384,6 +385,8 @@ rotatestrategy = ROTATE; } else if (strcasecmp(s, "sequential") == 0) { rotatestrategy = SEQUENTIAL; + } else if (strcasecmp(s, "none") == 0) { + rotatestrategy = NONE; } else { fprintf(stderr, "Unknown rotatestrategy: %s\n", s); } @@ -572,6 +575,9 @@ char *suffixes[4] = { "", ".gz", ".bz2", ".Z" }; switch (rotatestrategy) { + case NONE: + /* No rotation */ + break; case SEQUENTIAL: for (x = 0; ; x++) { snprintf(new, sizeof(new), "%s.%d", filename, x); @@ -762,7 +768,7 @@ } if (f->fileptr && (f->fileptr != stdout) && (f->fileptr != stderr)) { int rotate_this = 0; - if (ftello(f->fileptr) > 0x40000000) { /* Arbitrarily, 1 GB */ + if (rotatestrategy != NONE && ftello(f->fileptr) > 0x40000000) { /* Arbitrarily, 1 GB */ /* Be more proactive about rotating massive log files */ rotate_this = 1; }