[Rt-commit] rt branch, 4.0/better-mail-error-logging, created. rt-4.0.11rc1-2-gdddc054

Thomas Sibley trs at bestpractical.com
Wed Mar 27 00:38:03 EDT 2013


The branch, 4.0/better-mail-error-logging has been created
        at  dddc05435f84eed91a2a452d594432cb9412e42c (commit)

- Log -----------------------------------------------------------------
commit 5d153f131eb1943de0b2b4904aadcb9d1c306808
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Mar 26 21:34:37 2013 -0700

    Log the subject of mail errors in addition to the explanation
    
    The subject often offers an indication of the action and email that
    failed, while the explanation is usually pretty terse.  This is
    especially true when the explanation is the direct result of an API
    call.

diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
index ddf27da..1cd0b32 100644
--- a/lib/RT/Interface/Email.pm
+++ b/lib/RT/Interface/Email.pm
@@ -225,8 +225,8 @@ add 'In-Reply-To' field to the error that points to this message.
 
 =item Attach - optional text that attached to the error as 'message/rfc822' part.
 
-=item LogLevel - log level under which we should write explanation message into the
-log, by default we log it as critical.
+=item LogLevel - log level under which we should write the subject and
+explanation message into the log, by default we log it as critical.
 
 =back
 
@@ -247,7 +247,7 @@ sub MailError {
 
     $RT::Logger->log(
         level   => $args{'LogLevel'},
-        message => $args{'Explanation'}
+        message => "$args{Subject}: $args{'Explanation'}",
     ) if $args{'LogLevel'};
 
     # the colons are necessary to make ->build include non-standard headers

commit dddc05435f84eed91a2a452d594432cb9412e42c
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Mar 26 21:36:24 2013 -0700

    Include Correspond/Comment in the subject when recording a mail error
    
    This indicates for the RT admin looking in the logs what type of action
    failed.

diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
index 1cd0b32..56ab06e 100644
--- a/lib/RT/Interface/Email.pm
+++ b/lib/RT/Interface/Email.pm
@@ -1621,7 +1621,7 @@ sub Gateway {
                 #Warn the sender that we couldn't actually submit the comment.
                 MailError(
                     To          => $ErrorsTo,
-                    Subject     => "Message not recorded: $Subject",
+                    Subject     => "Message not recorded ($method): $Subject",
                     Explanation => $msg,
                     MIMEObj     => $Message
                 );

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


More information about the Rt-commit mailing list