You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Jerry Malcolm <te...@malcolms.com> on 2019/10/07 16:42:41 UTC

Proposal: MailetPipelineLogging.java enhancement

Ok... I'm jumping in headfirst....:-)  This is a simple one for my first 
time....

Problem a: Logging enter/exit of the service(..) method of mailets is 
huge for serviceability.  However, the current code in 
MailetPipelineLogging.java simply says we entered mailet xyz and exited 
mailet xyz.   for me, 99% of the time when I care about whether I 
entered a particular mailet, it's because I have a problem/question 
about the flow of a particular mail item.  I'm trying determine if 
'this' email item entered mailet xyz.  But if 1000 other mailets DID 
enter mailet xyz in the last hour, the current logging is not going to 
be helpful in that situation.

Problem b: The latest Log4j.properties has no entries covering 
org.apache.mailet which is the package prefix for MailetPipelineLogging. 
   So currently, no log output from that class will appear in any of the 
logs.

Proposed solution to a: Add "mail.getName()" to the log strings in 
logBeginOfMailetProcess(..) and logEnddOfMailetProcess(..) so that the 
log will now say "Entering mailet: xyz (<mailId>). With this information 
now in the log, it will be very easy to grep a log file for the mailId 
and see the entire trace through the mailet container.

Proposed solution to b: Add log4j.logger.org.apache.mailet.base=DEBUG, 
MAILETCONTAINER  (or default to INFO if preferred).  Also possibly add 
log4j.logger.org.apache.james=DEBUG, CONS, FILE to pick up the mailet 
trace in the main james log and the console.  I have no real preferences 
for the specifics for log4j.properties.  However, I think the package 
entry needs to be in there.  When I have a problem I simply do a 
change-all to DEBUG to see what info I get. A user would never know this 
mailet trace was available even with everything set to DEBUG unless this 
package is defined somewhere in there.

I've made these changes locally, and everything seems to be working.  
Upon your recommendation I'll try to figure out 'pull' requests and open 
one.

Jerry



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org