Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-1425

Logging / debugging Apache James bundled / shipped Mailets



    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.0-beta4
    • 3.0-beta4
    • None
    • Linux 2.6.32-71.el6.i686 #1 SMP Fri Nov 12 04:17:17 GMT 2010 i686 i686 i386 GNU/Linux


      I am unable to log at the debug level (ie. debug) the bundled Apache James Beta4 Mailets such as DSNBounce mailet (org.apache.james.transport.mailets.DSNBounce class). I am using the standard
      shipped log4j.properties file, and set all pertinent loggers to DEBUG. I've tried various things including :
      a. adding <debug>true</debug> in the conf/mailetcontainer.conf under <mailet match="All" class="DSNBounce">
      b. recompiling my custom james-server-mailets-3.0-beta4.jar with DSNBounce Mailet having
      its own org.apache.log4j.Logger instance and overriden public void log() methods using the
      org.apache.log4j.Logger to log (Note: this method does cause DSNBounce to log messages
      DURING Apache James initialization; however, AFTER it is fully initialized (ie. after I see a
      "INFO 15:46:19,872 | org.apache.james.app.spring.JamesAppSpringMain | Apache James Server is successfully started in 19585 milliseconds.") there are no log messages from DSNBounce
      even after a bounce message is generated by Apache James (as logged by my custom mailets).
      It seems that after the Camel processor kicks in, logging from bundled Apache James Beta4 Mailets
      stops being logged.

      From looking at the code I can see that all bundled Mailets are using GenericMailet.log() method that's
      actually using JamesMailetContext.log() (getMailetContext().log()), which uses a Spring-injected LogProvider which creates a Logger instance with "james" pre-panded to the bean name.

      Note: I am able to log at the DEBUG level my custom mailets just fine by using org.apache.log4j.Logger instance within them and implementing the Mailet interface (rather than inheriting from GenericMailet, which I presume would also suffer from this issue) and have a corresponding entry for them in log4j.properties.




            Unassigned Unassigned
            idea.harness Idea Harness
            0 Vote for this issue
            0 Start watching this issue