1

I want to write a custom appender which will collect all the logs coming to Fuse.log in Fuse container and relay them over Scribe to a central log store. I want to add a event listener for that in the container. But I couldn't figure out how I can do that. I went through the PAX logging code. But couldn't figure out. Any suggestions greatly appreciated.

Nipun Talukdar
  • 4,975
  • 6
  • 30
  • 42

2 Answers2

1

pax logging just uses log4j as the implementation. So I would write a log4j appender to do this instead. here is a library which does this already, but I've never touched it. https://code.google.com/p/scribe-log4j/

Sheena Artrip
  • 1,990
  • 12
  • 16
1

I wrote once a blog post about this, it can be found at my blog. Basically you just need to create your appender, the tricky part is in adding it to pax-logging in the container via a fragment bundle.

Achim Nierbeck
  • 5,265
  • 2
  • 14
  • 22
  • Thanks. I followed your blog and everything worked fine. – Nipun Talukdar Jan 29 '14 at 04:50
  • Hey @AchimNierbeck can you help on this? [http://stackoverflow.com/questions/28232220/add-custom-log4j2-appender-for-karaf-and-pax-logging](http://stackoverflow.com/questions/28232220/add-custom-log4j2-appender-for-karaf-and-pax-logging) – Honey Goyal Jan 30 '15 at 08:56