You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Nicholas Williams <ni...@nicholaswilliams.net> on 2013/07/16 17:52:53 UTC

LOG4J2-291 and error handling

If it helps, check out LOG4J2-291. I may be handling errors
incorrectly in the JDBC/JPA/NoSQL appenders. If an exception is thrown
within the *Manager write methods, should I just let that exception
propagate (wrapping it if it's a checked exception that I can't
throw)? Should I wrap all exceptions in some standard exception
(LoggingException or something similar)? Right now I'm catching
exceptions and logging them using the SimpleLogger. I may need to
change that behavior.

Nick

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


Re: LOG4J2-291 and error handling

Posted by Gary Gregory <ga...@gmail.com>.
Great, thank you for the update.

Gary


On Wed, Jul 17, 2013 at 10:18 AM, Nick Williams <
nicholas@nicholaswilliams.net> wrote:

> Yes. As soon as I commit the new Log4j2Logger to JBoss Logging, I'm
> switching to Log4j to clean up my appenders/managers and look for any other
> appenders/managers that suppress exceptions that prevent messages from
> being logged.
>
> Nick
>
>
> On Jul 17, 2013, at 8:26 AM, Gary Gregory wrote:
>
> Nick,
>
> Will you be making these changes?
>
> Gary
>
>
> On Tue, Jul 16, 2013 at 12:39 PM, Ralph Goers <ra...@dslextreme.com>wrote:
>
>> As a general rule exceptions in appenders that cause the log event to
>> fail to be written should be percolated.  AppenderControl has the ability
>> to suppress them if that is what the user wants.  But the FailoverAppender
>> can't do its work unless the exceptions percolate to it.
>>
>> Ralph
>>
>> On Jul 16, 2013, at 8:52 AM, Nicholas Williams wrote:
>>
>> > If it helps, check out LOG4J2-291. I may be handling errors
>> > incorrectly in the JDBC/JPA/NoSQL appenders. If an exception is thrown
>> > within the *Manager write methods, should I just let that exception
>> > propagate (wrapping it if it's a checked exception that I can't
>> > throw)? Should I wrap all exceptions in some standard exception
>> > (LoggingException or something similar)? Right now I'm catching
>> > exceptions and logging them using the SimpleLogger. I may need to
>> > change that behavior.
>> >
>> > Nick
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> > For additional commands, e-mail: log4j-dev-help@logging.apache.org
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>>
>>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: LOG4J2-291 and error handling

Posted by Nick Williams <ni...@nicholaswilliams.net>.
Yes. As soon as I commit the new Log4j2Logger to JBoss Logging, I'm switching to Log4j to clean up my appenders/managers and look for any other appenders/managers that suppress exceptions that prevent messages from being logged.

Nick

On Jul 17, 2013, at 8:26 AM, Gary Gregory wrote:

> Nick,
> 
> Will you be making these changes?
> 
> Gary
> 
> 
> On Tue, Jul 16, 2013 at 12:39 PM, Ralph Goers <ra...@dslextreme.com> wrote:
> As a general rule exceptions in appenders that cause the log event to fail to be written should be percolated.  AppenderControl has the ability to suppress them if that is what the user wants.  But the FailoverAppender can't do its work unless the exceptions percolate to it.
> 
> Ralph
> 
> On Jul 16, 2013, at 8:52 AM, Nicholas Williams wrote:
> 
> > If it helps, check out LOG4J2-291. I may be handling errors
> > incorrectly in the JDBC/JPA/NoSQL appenders. If an exception is thrown
> > within the *Manager write methods, should I just let that exception
> > propagate (wrapping it if it's a checked exception that I can't
> > throw)? Should I wrap all exceptions in some standard exception
> > (LoggingException or something similar)? Right now I'm catching
> > exceptions and logging them using the SimpleLogger. I may need to
> > change that behavior.
> >
> > Nick
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-dev-help@logging.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
> 
> 
> 
> 
> -- 
> E-Mail: garydgregory@gmail.com | ggregory@apache.org 
> Java Persistence with Hibernate, Second Edition
> JUnit in Action, Second Edition
> Spring Batch in Action
> Blog: http://garygregory.wordpress.com 
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory


Re: LOG4J2-291 and error handling

Posted by Gary Gregory <ga...@gmail.com>.
Nick,

Will you be making these changes?

Gary


On Tue, Jul 16, 2013 at 12:39 PM, Ralph Goers <ra...@dslextreme.com>wrote:

> As a general rule exceptions in appenders that cause the log event to fail
> to be written should be percolated.  AppenderControl has the ability to
> suppress them if that is what the user wants.  But the FailoverAppender
> can't do its work unless the exceptions percolate to it.
>
> Ralph
>
> On Jul 16, 2013, at 8:52 AM, Nicholas Williams wrote:
>
> > If it helps, check out LOG4J2-291. I may be handling errors
> > incorrectly in the JDBC/JPA/NoSQL appenders. If an exception is thrown
> > within the *Manager write methods, should I just let that exception
> > propagate (wrapping it if it's a checked exception that I can't
> > throw)? Should I wrap all exceptions in some standard exception
> > (LoggingException or something similar)? Right now I'm catching
> > exceptions and logging them using the SimpleLogger. I may need to
> > change that behavior.
> >
> > Nick
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-dev-help@logging.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: LOG4J2-291 and error handling

Posted by Ralph Goers <ra...@dslextreme.com>.
As a general rule exceptions in appenders that cause the log event to fail to be written should be percolated.  AppenderControl has the ability to suppress them if that is what the user wants.  But the FailoverAppender can't do its work unless the exceptions percolate to it.

Ralph

On Jul 16, 2013, at 8:52 AM, Nicholas Williams wrote:

> If it helps, check out LOG4J2-291. I may be handling errors
> incorrectly in the JDBC/JPA/NoSQL appenders. If an exception is thrown
> within the *Manager write methods, should I just let that exception
> propagate (wrapping it if it's a checked exception that I can't
> throw)? Should I wrap all exceptions in some standard exception
> (LoggingException or something similar)? Right now I'm catching
> exceptions and logging them using the SimpleLogger. I may need to
> change that behavior.
> 
> Nick
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
> 


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