Migrating to log4j2
The YFCLogCategory class that is primarily used for logging by the Sterling™ Order Management System code and also used by the customer code does not extend
org.apache.log4j.Category, which is a log4j 1.x class. Your custom code is impacted
with this release if you are using methods that are not defined by the
YFCLogCategory class. Methods that are not defined by the
YFCLogCategory class and are available from the
org.apache.log4j.Category parent class, are not supported.
YFCLogCategory class to ensure that
no runtime failures of the custom code occur. However, these are dummy methods and might be removed
in a later release.public void log(Object level, Object obj)public void setLevel(Object level)public boolean isEnabledFor(Object level)
The YFCLogCategory.getLogger() method is not supported. Use the
YFCLogCategory.instance(Class.class) method instead.
private static YFCLogCategory logger = YFCLogCategory.instance(MyClassName.class);- If you are casting the
YFCLogCategoryinstance toorg.apache.log4j.Categoryororg.apache.log4j.Logger, it is not supported. Casting an instance ofYFCLogCategorytoorg.apache.log4j.Loggerororg.apache.log4j.Categorydoes not compile when writing new code. For existing custom code that has these casts, the custom code encounters theClassCastExceptionat run time. For example, line #2 and #3 from the following code pattern are not supported.YFCLogCategory LOGGER = YFCLogCategory.instance(MyClass.class.getName()); org.apache.log4j.Logger apLogger=(org.apache.log4j.Logger)LOGGER; // Not supported org.apache.log4j.Category apCategory=(org.apache.log4j.Category)LOGGER; // Not supported - If you are calling
log(Level level, Object), replace it with specific methods such as error(Object) or debug(Object) that are provided by theYFCLogCategoryclass. - If you are calling
setLevel(Level level), you must delete it. You cannot change levels of loggers in log4j2 because it is not supported in the log4j2 API. Further management of log levels is done by the code, and you must create traces for specific parts of the code for which you want extended logging. - If you are calling
isEnabledFor(Level level), replace it with specific methods such as isInfoEnabled or isTimerEnabled.
Discontinuation of log4j-1.x jars
Any log4j-1.x jars are not supported in IBM Sterling Order Management System as
part of the customer's customization package.
Discontinuation of log4j1 to log4j2 bridge jars
The log4j1 to log4j2 bridge jars are not supported. For example,
adding log4j-1.2-api-2.17.1.jar to a customization package is not supported.
You must update your custom code or upgrade any third-party jars that still depend on log4j-1.x. Log4j-1.x is deprecated and is no longer supported by Apache. If you have third-party libraries that still require log4j 1.x, these are likely outdated libraries. You should migrate to the latest version of these third-party libraries or look for safer alternatives if the libraries are updated to use log4j2.