class DebugLogAppender extends AbstractAppender
{
    protected DebugLogAppender(String name, Filter filter, Layout<? extends Serializable> layout,
            final boolean ignoreExceptions)
    {
        super(name, filter, layout, ignoreExceptions, Property.EMPTY_ARRAY);
    }

    @PluginFactory
    public static DebugLogAppender createAppender(@PluginAttribute("name") String name,
            @PluginElement("Filter") Filter filter,
            @PluginElement("Layout") Layout<? extends Serializable> layout,
            @PluginAttribute("ignoreExceptions") boolean ignoreExceptions) {
        return new DebugLogAppender(name, filter, layout, ignoreExceptions);
    }

    @Override
    public void append(LogEvent event)
    {
        // forward to your logging dialog box here.
        LogDialog.instance().log(event.getLoggerName(), event.getLevel().name(),
                event.getMessage().getFormattedMessage(), event.getThrown());
    }

    public static void setupCustomLogger()
    {<FILL_FUNCTION_BODY>}
}

        ConfigurationBuilder<BuiltConfiguration> builder = ConfigurationBuilderFactory
                .newConfigurationBuilder();

        AppenderComponentBuilder appenderBuilder = builder.newAppender("Custom", "DebugLogAppender");
        appenderBuilder.add(builder.newLayout("PatternLayout").addAttribute("pattern",
                "%d [%t] %-5level: %msg%n%throwable"));
        builder.add(appenderBuilder);

        builder.add(builder.newRootLogger(Level.INFO).add(builder.newAppenderRef("Custom")));
        Configurator.initialize(builder.build());
    
<no_super_class>