Add new config 'log_showsyncname', defaulting to 1 (on), which will show the name...
authorGreg Sabino Mullane <greg@endpoint.com>
Fri, 18 Oct 2013 02:42:28 +0000 (22:42 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Fri, 18 Oct 2013 02:42:28 +0000 (22:42 -0400)
So rather than this:
(29985) [Thu Oct 17 22:40:12.885 2013] KID Database "A" backend PID: 29987
You will see this:
(29985) [Thu Oct 17 22:40:12.885 2013] KID (fctest) Database "A" backend PID: 29987
As suggested by Michelle Sullivan on the mailing list.

Bucardo.pm
bucardo.schema

index a80157c0f5077aec7f3d04e95bd47ec4f2dafdb1..50ea622106cbe0571e2e506dadfd401cf4ff6984 100644 (file)
@@ -1982,6 +1982,10 @@ sub start_kid {
     ## Adjust the process name, start logging
     $0 = qq{Bucardo Kid.$self->{extraname} Sync "$syncname"};
     my $extra = $sync->{onetimecopy} ? "OTC: $sync->{onetimecopy}" : '';
+    if ($config{log_showsyncname}) {
+        $self->{logprefix} .= " ($syncname)";
+    }
+
     $self->glog(qq{New kid, sync "$syncname" alive=$kidsalive Parent=$self->{ctlpid} PID=$$ kicked=$kicked $extra}, LOG_TERSE);
 
     ## Store our PID into a file
@@ -5119,8 +5123,9 @@ sub _logto {
             $fn .= ".$self->{logextension}" if length $self->{logextension};
 
             ## If we are writing each process to a separate file,
-            ## append the prefix and the PID to the file name
-            $fn .= "$self->{logprefix}.$$"  if $self->{logseparate};
+            ## append the prefix (first three letters) and the PID to the file name
+            my $tla = substr($self->{logprefix},0,3);
+            $fn .= "$tla.$$"  if $self->{logseparate};
 
             open my $fh, '>>', $fn or die qq{Could not append to "$fn": $!\n};
             ## Turn off buffering on this handle
index 5b78b1436cf80c972481adbed4c677817f1ba7b8..7ec921f68a3f9c2a274ba905b4175f73147b0338 100644 (file)
@@ -138,6 +138,7 @@ log_showlevel|0|Show log level in the log output?
 log_showline|0|Show line number in the log output?
 log_showtime|3|Show timestamp in the log output?  0=off  1=seconds since epoch  2=scalar gmtime  3=scalar localtime
 log_conflict_file|bucardo_conflict.log|Name of the conflict detail log file
+log_showsyncname|1|Show the name of the sync next to the 'KID' prefix
 log_level|NORMAL|How verbose to make the logging. Higher is more verbose.
 warning_file|bucardo.warning.log|File containing all log lines starting with "Warning"
 \.