Enrico Scantamburlo
Enrico Scantamburlo

Reputation: 99

Log4J Bridge 1 to 2.17.1 properties are not resolved

I am trying to use the log4j bridge to migrate my application. I have added the jars and set the configuration properties that are found and loaded.

The first problem was that log4j was not able to find the FileAppender class, I checked in the bridge jar and it is not present. I took the one from the original 1.2 release and made it compile and it works. I do not know if it is the right way because the migration tutorial says it should be handled automatically.

The thing that is causing me problems now is that when log4j loads the properties, they are not resolved correctly; I have

log4j.appender.FULL.file            = ${user.home}/${user.name}

but it does not work. I also tried

log4j.appender.FULL.file            = ${sys:user.home}/${sys:user.name}

and

log4j.appender.FULL.file            = $${sys:user.home}/$${sys:user.name}

without luck

I am using a custom appender that extends FileAppender and the value that is passed is not "expanded" .

Thanks

Upvotes: 1

Views: 645

Answers (1)

Enrico Scantamburlo
Enrico Scantamburlo

Reputation: 99

I opened a issue on the Log4j tracker and I discovered it was a bug on their end

https://issues.apache.org/jira/browse/LOG4J2-3312

Upvotes: 1

Related Questions