]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Make debug_options rotate=N option back-compatible.
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 5 Jun 2009 23:13:17 +0000 (11:13 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 5 Jun 2009 23:13:17 +0000 (11:13 +1200)
This ties older config which do not set rotate=N to still use the value
of logfile_rotate. If set rotate=N overrides logfile_rotate and can be
any value 0 or up.

src/cache_cf.cc
src/cf.data.pre
src/debug.cc

index cb6767d9b7e8743d4355cabe918eef3c7bf9fb43..be7315f6a177d72571062164d8af2307241fca22 100644 (file)
@@ -427,6 +427,10 @@ configDoConfigure(void)
     memConfigure();
     /* Sanity checks */
 
+    if (Debug::rotateNumber < 0) {
+        Debug::rotateNumber = Config.Log.rotateNumber;
+    }
+
 #if SIZEOF_OFF_T <= 4
     if (Config.Store.maxObjectSize > 0x7FFF0000) {
         debugs(3, 0, "WARNING: This Squid binary can not handle files larger than 2GB. Limiting maximum_object_size to just below 2GB");
index 8fedb2d25a1115bd2e46e7774e142fbcfd175bef..32f38b1522863708a44ddec16a1637819fd55c5e 100644 (file)
@@ -2635,7 +2635,7 @@ DOC_END
 
 NAME: debug_options
 TYPE: eol
-DEFAULT: rotate=1 ALL,1
+DEFAULT: ALL,1
 LOC: Debug::debugOptions
 DOC_START
        Logging options are set as section,level where each source file
@@ -2646,7 +2646,8 @@ DOC_START
        The magic word "ALL" sets debugging levels for all sections.
        We recommend normally running with "ALL,1".
 
-       The rotate= option can be increased to keep more of these logs.
+       The rotate=N option can be used to keep more or less of these logs
+       than would otherwise be kept by logfile_rotate.
        For most uses a single log should be enough to monitor current
        events affecting Squid.
 DOC_END
index 6e3bbc8055dc7c72b3c15b3a2ba606b87fc00f34..4088ba335b2674bf87990410aaee09af534ff8a2 100644 (file)
@@ -52,7 +52,7 @@ bool Debug::log_syslog = false;
 int Debug::Levels[MAX_DEBUG_SECTIONS];
 int Debug::level;
 char *Debug::cache_log = NULL;
-int Debug::rotateNumber = 1;
+int Debug::rotateNumber = -1;
 FILE *debug_log = NULL;
 static char *debug_log_file = NULL;
 static int Ctx_Lock = 0;