I have to add a panel to an application, this panel will log the errors of the application. I have create a class wich extends AppenderBase and i have configure the xml file to use this class.
So when i log somehting in the application, the appender he's called.
But at the moment i don't know how to link my appender to my panel.
Can you guide me please ?
For this you have to write your custom
Appender
, for this see :logback.qos.ch/manual/appenders.html. Then you need to using a component such as JTextArea for showinglog
in it. Then you have to write aProgrammatic Configuration logback
for relation between yourcustom Appender
and yourSwing-Component
. see :logback.qos.ch/manual/joran.htmlWorking solution:
Custom appender class:
JTextPane instance example:
And:
logback.xml: