google/flogger

Add log4j backend

EdwinKempin opened this issue ยท 9 comments

We want to use Flogger in Gerrit where we currently use slf4j with a log4j backend. We want to continue using log4j as backend so that the switch to Flogger is transparent for existing Gerrit installations and existing log4j configurations continue to work.

You can assign this issue to me. I'm already looking at ways to implement this.

Started this for logback: https://github.com/cslee00/digitalascent-flogger-logback, working through how to drop it into Flogger

Would there be much harm in having an slf4j backend?

@ben-manes Do I get it right that you suggest chaining flogger to slf4j to any of the logging frameworks underneath? In a sense that this would be more flexible than the suggest log4j-only implementation? If so, I'm +1. :)

Clunky to chain together two logging APIs (flogger, slf4j) - there are overlaps in responsibilities as they both provide a facade on back-end logging implemementations. Cleanest from an implementation & performance perspective to use back-end loggers directly.

This got merged now:
#23

What about log4j2 backend? There are these CLs pending for review for Gerrit: [1] and many other distros, e.g. ElasticSearch (that Gerrit currently depends on) already migrated to log4j2.

[1] https://gerrit-review.googlesource.com/#/q/topic:update-log4j-to-log4j2

I think writing a backend for log4j2 would be straight-forward now that we have one for log4j, but it's nothing I'm planning to look at.

Though log4j2 syntax is significantly different to log4j.