I want to write custom appenders for consoleAppender and RollingFileAppender to add another few custom fields to the log. With Log4j1 it was possible with subAppend() method. Log4j2 does not provide this method. How can I implement this in Log4j2?
Asked
Active
Viewed 441 times
1 Answers
1
In log4j2, you would create a plugin for this. The manual has an explanation with an example for a custom appender here:
http://logging.apache.org/log4j/2.x/manual/extending.html#Appenders
on plugins:
http://logging.apache.org/log4j/2.x/manual/plugins.html
If you are looking for RollingFileAppender work with log4j2

KishanCS
- 1,357
- 1
- 19
- 38