From: Jared Johnson <jar...@jello.nmgi.com>

This should allow the logging/file plugin to log even if it isn't called from
within a transaction
---
 plugins/logging/file |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/plugins/logging/file b/plugins/logging/file
index 31292ad..5717fe5 100644
--- a/plugins/logging/file
+++ b/plugins/logging/file
@@ -263,13 +263,15 @@ sub hook_logging {
     # - It's not already open
     # - We're allowed to split sessions across logfiles
     # - We haven't logged anything yet this session
+    # - We aren't in a session
     if (!$self->{_f} ||
         !$self->{_nosplit} ||
+        !$transaction ||
         !$transaction->notes('file-logged-this-session')) {
         unless (defined $self->maybe_reopen($transaction)) {
             return DECLINED;
         }
-        $transaction->notes('file-logged-this-session', 1);
+        $transaction->notes('file-logged-this-session', 1) if $transaction;
     }
 
     my $f = $self->{_f};
-- 
1.6.0.4

Reply via email to