logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MC Moisei <mcmoi...@comcast.net>
Subject Log4J Question
Date Fri, 02 Jun 2006 02:41:12 GMT
Hi,

Why  error(Object,Throwable) show the stack and error(Throwable) doesn't ?

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
...
class EmailVerificationAction
{

        private final static Log logger = LogFactory.getLog(
EmailVerificationAction.class );

        try
        {
            EmailService service = ( EmailService )
ServiceLocator.getService( "emailService" );
            sent = service.sendMessage( null, to, subject, text, html,
null );
        }
       
        catch ( Exception e )
        {
            logger.error( "Some Error", e );//shows stack trace
            logger.error( e );//doesn't show trace
        }
}

Mime
View raw message