[ 
https://issues.apache.org/jira/browse/LOG4J2-303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13705948#comment-13705948
 ] 

Tom Smith commented on LOG4J2-303:
----------------------------------


Sorry for the confusion. A text area writer is just a java.io.Writer subclass 
we have written with a TextArea that is used to display text. The TextArea is 
not important.


This is what I can do in Log4j 1.2 and not in Log4j2---I append a subclass of 
java.io.Writer to the logger.  Key points are in bold

import java.io.Writer;

     final Writer taw = new Writer();// you can't actually do this-Writer is 
abstract, so I use a subclass in the real code.
 
     final WriterAppender wa = new WriterAppender(new 
PatternLayout(simplePattern), taw);
     final org.apache.log4j.Logger theLog = 
org.apache.log4j.Logger.getLogger("com.dd");
     theLog.addAppender(wa);

Done!

This is a nice simple way to add a non-file, non-console appender to a logger. 
Can't do that in Log4j2

Best,

Tom






                
> No WriterAppender functionality in Log4j2
> -----------------------------------------
>
>                 Key: LOG4J2-303
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-303
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: log4j 1.2 emulation
>    Affects Versions: 2.0-beta7
>            Reporter: Tom Smith
>
> I have an app that uses a log4J 1.2 style WriterAppender to write to a JavaFX 
> window that so it can display the output in various ways (console, table 
> etc).  I can't get the same functionality with Log4j2-- Is this a deliberate 
> oversight because of the xml configuration system?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to