[Rt-commit] rt branch, 4.0/standard-log-message-tweaks, created. rt-4.0.13-153-gf1afa15

Thomas Sibley trs at bestpractical.com
Thu Jul 11 19:09:25 EDT 2013


The branch, 4.0/standard-log-message-tweaks has been created
        at  f1afa1541fa25caa53a1353f828a03c84124c5da (commit)

- Log -----------------------------------------------------------------
commit fbc0f1ac246c109cb3ed08e0ca82ac8d3285a4a9
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Jul 11 16:04:12 2013 -0700

    Show filename and line in syslog only when the level _is_ debug
    
    … instead of only when it _isn't_.  The commit which introduced logging
    to syslog, b5956dc, had this backwards from the start.

diff --git a/lib/RT.pm b/lib/RT.pm
index 0599cc3..f4a5c2c 100644
--- a/lib/RT.pm
+++ b/lib/RT.pm
@@ -279,9 +279,9 @@ sub InitLogging {
 
             $p{message} =~ s/(?:\r*\n)+$//;
             if ($p{level} eq 'debug') {
-                return "$p{message}\n";
-            } else {
                 return "$p{message} ($filename:$line)\n";
+            } else {
+                return "$p{message}\n";
             }
         };
 

commit f1afa1541fa25caa53a1353f828a03c84124c5da
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Jul 11 16:07:28 2013 -0700

    Log the process id at the beginning of each log line
    
    This helps differentiate multiple web server processes when untangling
    logs.  It's very useful for tracing mail flow more quickly.

diff --git a/lib/RT.pm b/lib/RT.pm
index f4a5c2c..91123b2 100644
--- a/lib/RT.pm
+++ b/lib/RT.pm
@@ -260,7 +260,7 @@ sub InitLogging {
             my ($package, $filename, $line) = caller($frame);
 
             $p{'message'} =~ s/(?:\r*\n)+$//;
-            return "[". gmtime(time) ."] [". $p{'level'} ."]: "
+            return "[$$] [". gmtime(time) ."] [". $p{'level'} ."]: "
                 . $p{'message'} ." ($filename:$line)\n";
         };
 
@@ -279,9 +279,9 @@ sub InitLogging {
 
             $p{message} =~ s/(?:\r*\n)+$//;
             if ($p{level} eq 'debug') {
-                return "$p{message} ($filename:$line)\n";
+                return "[$$] $p{message} ($filename:$line)\n";
             } else {
-                return "$p{message}\n";
+                return "[$$] $p{message}\n";
             }
         };
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list