Explorar o código

Be a bit more careful about adding data to the DBI log

Signed-off-by: N/A
Hours-billed: N/A
George S. Baugh hai 4 meses
pai
achega
5bd0ceacff
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      lib/Trog/Log/DBI.pm

+ 5 - 2
lib/Trog/Log/DBI.pm

@@ -42,8 +42,11 @@ sub log_message {
     if ( !$date ) {
         ( $date, $uuid, $ip, $user, $message ) = $msg =~ m!^([\w|\-|:]+) \[\w+\]: RequestId ([\w|\-]+) From ([\w|\.|:]+) \|(\w+)\| (.+)!;
 
-        $buffer{$uuid} //= [];
-        push( @{ $buffer{$uuid} }, $message );
+        # If we can't figure out its request, ignore the message
+        if(length $uuid) {
+            $buffer{$uuid} //= [];
+            push(@{$buffer{$uuid}}, $message);
+        }
         return 1;
     }