Why reconfigure? Just have the initial writer be a noop.

Sent from my iPhone

> On Jun 18, 2015, at 3:49 PM, Gary Gregory <[email protected]> wrote:
> 
> Hi All:
> 
> I have a use case where I use Log4j 2 for logging within a JDBC driver. I'd 
> like to support the DataSource#setLogWriter(PrintStream) API in a fairly 
> simple way. Granting that Log4j must be configured, if the user calls 
> setLogWriter, I'd like to add a "print writer appender" to Log4j such that 
> the user's PrintWriter becomes an appender target for log events.
> 
> Any thoughts on getting this to work considering that the setLogWriter API 
> can be called at any time in an apps life cycle. If I can get a clean impl, 
> I'd like to put it in the iostreams module.
> 
> Does this require a full reconfigure of log4j or is there a way to "just add 
> an appender" programatically?
> 
> Gary
> 
> -- 
> E-Mail: [email protected] | [email protected] 
> 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

Reply via email to