void main(String argv[]) {
JFrame frame = new JFrame("asdasd");
Category root = Category.getRoot();
PatternLayout layout = new PatternLayout("%p [%t] $c{2} %m\n");
TextPaneAppender ap = new TextPaneAppender(layout, "c");
JTextPane textPane = ap.getTextPane();
textPane.setPreferredSize(new Dimension(200, 200));
frame.getContentPane().add(textPane);
frame.pack();
ap.getTextPane().setVisible(true);
frame.setVisible(true);
root.addAppender(ap);
cat.debug("Message 1.");
cat.debug("Message 2.");