openmrs-core: replace log4j 1 which is EOL

Thats already taken care of by the logging facade slf4j which is in core and everyone (core and modules) should use it instead of the logging implementation (be it log4j version 1 or 2).

I’m not saying to remove slf4j, I am saying we should use it :slight_smile: There is no need to inject its already in core a long time.

So as first step modules have to:

Replace their calls to commons-logging or log4j version 1 with calls to slf4j, so they are not tied to the logging implementation openmrs uses! Sample commit for the radiology module here. This can be done today on any branch. The only consequence when doing this switch is that:

slf4j does not support the log level FATAL. So it does not provide log.fatal() and thus such calls have to be changed into info.error(“message”, exception) or using markers info.error(MarkerFactory.getMarker(“FATAL”), “message”, exception)

I can think of a script/IDE automation to support module devs and am volunteering to do this for a handful.

As a background info for those who havent read it lets clean up logging - #5 by dkayiwa This step is independent of switching logging implementations and should be done regardless of whether we switch and when, it can be done ASAP.

As a second step modules have to:

Exchange their log4j.xml file that they include in the src/test/resources for testing purposes with a log4j2-text.xml. We will of course supply the file.