0

I tried to configurate Log4J2 per xml-file. I want to register an own appender (which shows an speciale panel if errors happend). With logback it was no problem - till I wanted to use it in my webStart-Project. So I hope it works with log4j2. With my own configuration I get an CLASS_NOT_FOUND output.

I am looking the log4j2 xml-shema for:

<appender name="myAppender" class="mypackage.myappender">

I tried everything like

<Appenders>
  <Myappender name="MyAppender" class="mypackage.myappender">
  </Myappender>
</Appenders>

I hope someone can help me.

P.S.: sorry for my bad english

PCQ
  • 1
  • 1

1 Answers1

0

You would need to implement your appender as a log4j2 plugin. This is not that difficult (just look at some of the existing appenders to see which annotations to use and methods to implement).

You also need to help log4j2 find your plugin by specifying the appender's package in the configuration:

<Configuration packages="com.mycomp.mylog4j2appenderpackage">
  <Appenders>
    <MyAppender name="MyAppender" />
  </Appenders>
   ...
</Configuration>
Remko Popma
  • 35,130
  • 11
  • 92
  • 114