As we are mainly talking about a message tracing facility, another approach could be 
to have a mail attribute named something like "org.apache.james.trace", containing an 
ArrayList or similar kind of Collection, that *always* gets log messages appended as 
soon as they are issued (perhaps always at debug level) plus information about if and 
when a mail is "split" or resent etc. The administrator can insert a "DumpTrace" 
mailet line in any appropriate place in the config.xml file to have things printed to 
the mailet.log when needed. A "Log" mailet could also be inserted if useful, with 
<toLog> and <toTrace> options etc.

This approach IMHO could be useful and quite easy to implement.

Vincenzo 

> -----Original Message-----
> From: Noel J. Bergman [mailto:[EMAIL PROTECTED]
> Sent: mercoled� 30 luglio 2003 1.42
> To: James Developers List
> Subject: RE: Message path tracing
> 
> 
> As I've said, I'm just mulling over how to provide this feature cleanly.
> Steve's comment got me thinking, and as I followed up looking at this, I
> believe that we could implement message tracing by doing something with
> child loggers, the same way that the Mailet Log is a child logger 
> of James.
> 
> If we added some new log categories, which I'll just call MessageTrace for
> now, e.g.,
> 
>     James.MessageTrace
>     smtpserver.MessageTrace
>     spoolmanager.MessageTrace
> 
> and a new log target:
> 
>     MessageTrace
> 
> we could aggregate trace messages directly into that log, and 
> control it via
> the standard Avalon log controls.  The contents of that log would be
> messages that record the flow of messages through the system.  We 
> would not
> have the msgID.log files that Serge proposed, but one can type "grep key
> tracelog" almost as easily as "cat key.tracelog", and the former scales
> better.
> 
> We could have a method in the relevant components like:
> 
>     messageTrace(Mail, String)
> 
> which would get the child logger and emit the mail key along with the
> message.  Avalon adds the other log data.
> 
> One area still to be resolved is what to do with matcher/mailet messages.
> Sure, we can, and probably should, modify the MailetContext to 
> add messages
> from matchers/mailets to the trace log, but unfortunately, the 
> log() method
> does not support identifying the message, so how do we associate the log
> entry with the mail message?
> 
>       --- Noel
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to