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 "Kiytiro-Keane, A Massae" <ak...@harris.com> on 2012/05/08 21:16:14 UTC

Custom Mailet Logfile

Hello,

I'm using the LogFactory to log the info,error,trace types of information in my mailet. I cannot find where James output the mailet log. I checked the james-server.log and mailetcontainer.log. The mailetcontainer.log only shows information that the mailet has been instantiated.



Thank you.

Massae Kiytiro-Keane
FBC/332 Phone (321) 914-1452
"A person who never made a mistake never tried anything new." (by Albert Einstein)

This information is only intended for the use of the individual or entity named in this email. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the contents of this information is strictly prohibited. If you have received this email in error, please notify me and delete it immediately.




Re: Custom Mailet Logfile

Posted by Eric Charles <er...@apache.org>.
Hi,

The following snippet should work, but you need to configure 
log4j.properties.

I've updated the doc accordingly.

Thx, Eric

package com.test;

import javax.mail.MessagingException;

import org.apache.mailet.Mail;
import org.apache.mailet.base.GenericMailet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MyMailet extends GenericMailet{
   private static final Logger logger = 
LoggerFactory.getLogger(MyMailet.class);
   @Override
   public void service(Mail mail) throws MessagingException {
     log("log via mailet logger with INFO level");
     logger.info("Log via slf4j with INFO level !!! Add 
log4j.logger.com.test=INFO, CONS, FILE in the log4j.properties");
     logger.debug("Log via slf4j with DEBUG level !!! Add 
log4j.logger.com.test=DEBUG, CONS, FILE in the log4j.properties");
   }
}

On 05/08/2012 09:18 PM, Pao, Vanessa wrote:
> I see your message :)
>
> Vanessa Pao
> Software Engineer - Harris Healthcare Solutions
> 321.914.1344
> vpao@harris.com
>
>
> -----Original Message-----
> From: Kiytiro-Keane, A Massae [mailto:akiytiro@harris.com]
> Sent: Tuesday, May 08, 2012 3:16 PM
> To: server-dev@james.apache.org
> Subject: Custom Mailet Logfile
>
> Hello,
>
> I'm using the LogFactory to log the info,error,trace types of information in my mailet. I cannot find where James output the mailet log. I checked the james-server.log and mailetcontainer.log. The mailetcontainer.log only shows information that the mailet has been instantiated.
>
>
>
> Thank you.
>
> Massae Kiytiro-Keane
> FBC/332 Phone (321) 914-1452
> "A person who never made a mistake never tried anything new." (by Albert Einstein)
>
> This information is only intended for the use of the individual or entity named in this email. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the contents of this information is strictly prohibited. If you have received this email in error, please notify me and delete it immediately.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>

-- 
eric | http://about.echarles.net | @echarles

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


RE: Custom Mailet Logfile

Posted by "Pao, Vanessa" <vp...@harris.com>.
I see your message :)

Vanessa Pao
Software Engineer - Harris Healthcare Solutions
321.914.1344
vpao@harris.com


-----Original Message-----
From: Kiytiro-Keane, A Massae [mailto:akiytiro@harris.com] 
Sent: Tuesday, May 08, 2012 3:16 PM
To: server-dev@james.apache.org
Subject: Custom Mailet Logfile

Hello,

I'm using the LogFactory to log the info,error,trace types of information in my mailet. I cannot find where James output the mailet log. I checked the james-server.log and mailetcontainer.log. The mailetcontainer.log only shows information that the mailet has been instantiated.



Thank you.

Massae Kiytiro-Keane
FBC/332 Phone (321) 914-1452
"A person who never made a mistake never tried anything new." (by Albert Einstein)

This information is only intended for the use of the individual or entity named in this email. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the contents of this information is strictly prohibited. If you have received this email in error, please notify me and delete it immediately.




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