So I did try it with the double $$ and that still didn't work in the file name.
I am running with beta3. Below are the dependencies in my POM:
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0-beta3</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0-beta3</version>
</dependency>
Thanks,
Michael T Minella
----- Original Message -----
From: "Ralph Goers" <[email protected]>
To: "Log4J Users List" <[email protected]>
Sent: Friday, December 21, 2012 9:52:01 PM
Subject: Re: Map Lookup Question
Hmm. I just noticed that your question is about the file name. Are you running
with beta3? I thought that issue had been brought up in an earlier beta and
fixed.
Ralph
On Dec 21, 2012, at 4:23 PM, Michael Minella wrote:
>
> I'm looking at the log4j 2 's thread specific features and had a question. In
> my code I set an id as follows:
>
>
>
> ThreadContext.put( "id" , "Main" );
>
>
> and attempt to reference it in my configuration file as shown below:
>
>
>
> < File name = "File" fileName = "/tmp/myLog.log" >
> < PatternLayout pattern = "%X{id} %d{HH:mm:ss.SSS} [%t] %-5level %logger{36}
> - %msg ${ctx:id} %n" />
> </ File >
>
>
> If I use the lookup in the pattern layout to test it, it works fine. However,
> if I move that lookup to the fileName attribute in the line above, the
> replacement doesn't occur (my file ends up being named /tmp/${ctx.id}.log for
> example). Is that a limitation of that lookup or am I missing something? Any
> insight that can be provided is appreciated. Thanks in advance!
>
> Thanks,
> Michael T Minella
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]