Hello, Backend Engineers. Backend-infra are going to improve our logging library. Currently our backend services use Log4j1 logging framework. We are going to upgrade to Log4j2 logging framework and use SLF4J as our logging interface(facade).
The Benefits
To apply this upgrade on monorepo, there will be HUGE changes on our logging usage.
Changes on Monorepo(by order)
Logger.getLogger(Class)
to LoggerFactory.getLogger(Class)
Logger.fatal()
usage to Logger.error()
. Because SLF4J doesn't support fatal level.
Logger.log([Level|Priority], msg)
to Logger.[Level|Priority](msg)
. E.g. Logger.log(Level.INFO), msg)
to Logger.info(msg)
. Because no reason to use Logger.log()
in most usecase.
Logger.[Level](Object)
to Logger.[Level](Object.[toString|getMessage](), Object)
. E.g. Logger.error(exception)
to Logger.error(exception.getMessage(), exception)
Changes on multi-repo
For multi repo, code owners must update logging usage accordingly as code changes on monorepo above. On the next bei-common-library major version, all modules will use slf4j as logging facade and log4j2 as logging implementation.
Backend Engineers's Todo: Code review
As stated on the changes on monorepo section, the diff is already created, therefore if your team repositories are still in monorepo, please help by code review these following diffs. Expect partial-builds failed since these commits should be only one huge commit.
[Part 1] Refactor logging to SLF4J for domains with prefix a,b
[Part 2] Refactor logging to SLF4J for domains with prefix c,d
[Part 3] Refactor logging to SLF4J for domains with prefix e,f
[Part 4] Refactor logging to SLF4J for domains with prefix g,h
[Part 5] Refactor logging to SLF4J for domains with prefix i,j
[Part 6] Refactor logging to SLF4J for domains with prefix k,l
[Part 7] Refactor logging to SLF4J for domains with prefix m,n
[Part 8] Refactor logging to SLF4J for domains with prefix o,p
[Part 9] Refactor logging to SLF4J for domains with prefix q,r
[Part 10] Refactor logging to SLF4J for domains with prefix s,t
[Part 11] Refactor logging to SLF4J for domains with prefix u,v
[Part 12] Refactor logging to SLF4J for domains with prefix w,x
These diffs are planned to land on Wednesday, 12 Des 2018 00.00 AM. After these diffs are landed(will be announced). The logging convention will be using SLF4J instead of Log4j.