cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Log4j 2.0 updated APIs

RK_10805837
10-Marble

Log4j 2.0 updated APIs

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 

 

 

ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

5 REPLIES 5
avillanueva
22-Sapphire II
(To:RK_10805837)

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

Hi @HelesicPetr ,

yes I have included those packages. I

avillanueva
22-Sapphire II
(To:RK_10805837)

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

Announcements

Top Tags