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 Nicko Cadell <ni...@Neoworks.com> on 2002/11/05 17:28:57 UTC

Potential exception in object renderer is not caught

If a renderer throws an exception, the exception should be caught in
RendererMap.findAndRender(Object) (or somewhere near by). The exception is
propagated back through the LoggingEvent, the Layout and the Appender.

Should log4j do one of the following?

  - Write an error message via LogLog.Error (or its replacement)
  - Give an error string instead of the expected rendered object to the
appender(s)
  - Consume the exception :-)

Now I am not suggesting that the current renderers throw exceptions, just
that calling Object.ToString() (which is what the DefaultRenderer does)
could thrown a runtime exception due to the app developers bad code. Log4j
should protect itself from the user and the user from themselves!

Thanks,

Nicko

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>