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

Ralph Goers commented on LOG4J2-303:
------------------------------------

I couldn't find TextAreaWriter in the JavaFX javadoc. However, with a bit of 
googling I was able to come up with the code below which would allow you to 
create a TextAreaAppender that extends AbstractOutputStreamAppender and would 
be similar to the ConsoleAppender.


private static OutputStream getOutputStream(TestArea ta) {
    return new TextAreaOutputStream(ta);    
}

private static class TextAreaOutputStream extends OutputStream {
    private final TextArea output;
    public TextAreaOutputStream(TextArea ta) {
        this.output = ta;
    }

    @Override
    public void write(int i) throws IOException {
        output.appendText(String.valueOf((char) i));
    }
}
                
> 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