logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pedro Costa" <pedro.co...@link.pt>
Subject RE: Logger.error
Date Fri, 03 Feb 2006 13:28:44 GMT
I don't really understand your solution. Can you give me an example?

Thanks,
Pedro

-----Original Message-----
From: Venkatray Kamath [mailto:Venkatray.Kamath@tavant.com] 
Sent: sexta-feira, 3 de Fevereiro de 2006 12:48
To: 'Log4J Users List'
Subject: RE: Logger.error

U could log the application exceptions as soon as exception object instance
is created ie in your case the constructor of PortletException can invoke
logger.error(); so that u don't depend on the client to log the exception.

-----Original Message-----
From: Pedro Costa [mailto:pedro.costa@link.pt]
Sent: Friday, February 03, 2006 6:15 PM
To: log4j-user@logging.apache.org
Subject: Logger.error

The Logger.error is a good method to print java exceptions?

If so, if I catch two java exceptions, for example:

                try {
                                //something
                        } catch (PortletException e) {
                                logger.error("Exception was: " + e);
                        } catch (IOException e) {
                                logger.error("Exception was: " + e);
},

Is it correct to change this snippet into something like this?

                        try {
                                //something
                        } catch (Exception e) {
                                logger.error("Exception was: " + e);
}
-----------------
PSC



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message