[ 
https://issues.apache.org/jira/browse/LOG4J2-3312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17468639#comment-17468639
 ] 

Enrico Scantamburlo commented on LOG4J2-3312:
---------------------------------------------

I had to remove the class name of the custom appender and all the comments.

If I use a simpler one seems to work (using the FileAppender)

{{{}log4j.rootLogger=INFO, FULL{}}}{{{}log4j.logger.org.apache.commons=OFF{}}}
{{{}log4j.logger.org.apache.http=OFF{}}}{{{}log4j.appender.FULL                
= /*I have to remove the class*/{}}}
{{log4j.appender.FULL.file            = ${user.home}/${user.name}}}
{{log4j.appender.FULL.append            = false}}
{{log4j.appender.FULL.layout            = org.apache.log4j.PatternLayout}}
{{log4j.appender.FULL.layout.ConversionPattern    = %d\{MMM dd yyyy 
HH:mm:ss,SSS} %-5p %c %x- %m\n}}

{{log4j.appender.FULL.DatePattern            = EEE}}
{{log4j.appender.FULL.longevity            = 604800000}}

{{log4j.appender.CONSOLE                = org.apache.log4j.ConsoleAppender}}
{{log4j.appender.CONSOLE.layout            = org.apache.log4j.PatternLayout}}
{{log4j.appender.CONSOLE.layout.ConversionPattern    = %d\{HH:mm:ss,SSS} %-5p 
%c %x- %m\n}}

> Bridge does not convert properties
> ----------------------------------
>
>                 Key: LOG4J2-3312
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3312
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: log4j 1.2 emulation
>    Affects Versions: 2.17.1
>            Reporter: Enrico Scantamburlo
>            Priority: Major
>
> I have tried to migrate my application from Log4j 1.2.17 to the latest.
> The first problem was that the class FileAppender was not inside the bridge 
> jar. 
> I resolved the issue copying the java file from the old version.
> Now I found out the that the properties that are in the log4j.properties are 
> not converted when passed to my custom appeder. 
> Like
> {{log4j.appender.FULL.file            = ${user.home}/${user.name}}}
> is not expanded to {{/home/escantam/escantam}}
> The properties file is found and loaded but the properties no expanded when 
> the setFile method is called.
> Is this a bug?
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to