Honey Goyal
Honey Goyal

Reputation: 445

Add custom log4j2 appender for Karaf and Pax Logging

I am trying to add new custom log4j2 appender. Karaf 3.0.2 use pax-logging 1.7.4 which does not support log4j2. I have a appender which extend org.apache.logging.log4j.core.appender.AbstractAppender.

I followed this blog http://blog.nanthrax.net/2012/12/create-custom-log4j-appender-for-karaf-and-pax-logging/ writen by Jean-Baptiste. It will not work because my appender is written in log4j2.

What are the alternatives so that karaf also log using this appender?

Upvotes: 1

Views: 1668

Answers (1)

Achim Nierbeck
Achim Nierbeck

Reputation: 5285

The answer is already in your question it doesn't work, and how is it supposed to. Version 3.0.2 of Karaf does use Pax Logging 1.7.x wich doesn't support Log4j2. So you just can't register a custom appender for log4j2, create a Log4j appender and add that to your configuration.
Or upgrade to Karaf 3.0.3 which uses Pax Logging 1.8.x which now also support Log4j2. Might want to try that.

Upvotes: 3

Related Questions