2

I am using log4j-1.2.17 and need to upgrade with log4j-2.17 (latest as of now). In log4j 1.x i am using some internal java class to build log4j configuration programmatically and imported some packages like

import org.apache.log4j.Hierarchy;
import org.apache.log4j.spi.LoggerRepository;
import org.apache.log4j.spi.RepositorySelector;
import org.apache.log4j.PropertyConfigurator;
import org.apache.log4j.xml.DOMConfigurator;
import org.apache.log4j.spi.RootCategory;

But i can see above packages are not available in log4j 2.17.0. I checked https://logging.apache.org/log4j/2.x/manual/migration.html and https://www.docs4dev.com/docs/en/log4j2/2.x/all/manual-migration.html but no luck.

can anyone please help me here? Thanks in advance.

Developer
  • 150
  • 2
  • 12
  • It's pretty much impossible to tell you how to replace them if we don't know what you're using them for. Some of them have already been asked and answered (linked duplicates), and some of them have been asked but not yet answered: https://stackoverflow.com/questions/70350783/log4j-2-15-0-domconfigurator-equivalent – Michael Dec 20 '21 at 13:57
  • You will need to reimplement your class :( – Luna Dec 20 '21 at 13:58
  • @Seelenvirtuose Erm, they already linked that themselves. – Michael Dec 20 '21 at 14:29
  • Hi, I suggest you follow this recommendation: https://stackoverflow.com/questions/70312033/how-to-mitigate-log4shell-vulnerability-in-version-1-2-of-log4j – Zvonko Dec 28 '21 at 14:21

0 Answers0