Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hello,
I am currently migrating the codebase from Windchill 11.1 to 12.0 and facing issues in the new log4j 2.0 package, namely in the following APIs-
Layout layout = new PatternLayout("%d [%t] %-5p %c - %m%n");
FileAppender appender = new FileAppender(layout, WTProperties
.getServerProperties().getProperty("wt.logs.dir")
+ File.separator + "SetStateOfAffectedObjects.log");
logger.addAppender(appender);
Anybody has any suggestions for the same?
Thank you,
Ramsha
Solved! Go to Solution.
Hi @RK_10805837
So what is your problem?
If you import correct packages, there can not be any issue.
do not forget to import all sub packages correctly...
PetrH
Hi @RK_10805837
If you migrating your code you need to update all apache logger import usage.
The logger is upgraded to new version so you need to change the apache package in any class import.
from
org.apache.log4j.Logger
to
org.apache.logging.log4j.Logger
the change apply for all apache log4j classes so
org.apache.logging.log4j.*
there is also variable change in the wt.properties file(but this is OOTB changed)
-Dlog4j2.configurationFile\=$(wt.manager.log4j.config)
PetrH
I think your message was cut off.
Hi @RK_10805837
So what is your problem?
If you import correct packages, there can not be any issue.
do not forget to import all sub packages correctly...
PetrH