ColdFusion 2021 and log4j2
My overall objective here is simply to be able to use a Java logging library, specifically log4j2 here, so that I can log user accesses to the application to a folder of my choice. And also make use of log rolling facility to copy log files to an archive directory at the end ofe very day.
I have been using log4j2 with ColdFusion 2016. I just placed the two jar files, log4j-api-2.6.2,jar and log4j-core-2.6.2.jar into the folder WEB-INF\lib and my config file, log4j2.xml into WEB-INF\classes. That worked fine because ColdFusion 2016 was using log4j version 1 and there was no conflict of package names. In ColdFusion 2021 it is using log4j version 2 and has the files log4j-api-2.13.3,jar and log4j-core-2.13.3.jar installed in cfusion/lib and now I get an error on the first call to log4j2 when it should be reading the configuration file.
It reports:
- ERROR StatusLogger Unrecognized format specifier
- ERROR StatusLogger Unrecognized conversion
This is simular to what is reported here, https://www.arctype.co/blog/resolve-log4j2-conflicts-in-uberjars, although this is not in a ColdFusion context.
Does anyone else face the issue? Does anyone have an idea how to appracoh this problem? Do I need to consider osgi?
Thanks,
William
