You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by kriegerd <kr...@gmail.com> on 2017/01/24 20:35:03 UTC

Problem with ThreadContextMapFilter

Hi everyone,

I'm trying to send messages to different files based on a key/value from
the current context.
To do that I set up 3 appenders all children of root with
different ContextMapFilter.

My configuration is attached.
Basically one appender will look for "External" entries, the other appender
"Internal" and the last one everything else (that's the intention at least).

What I'm seeing is ALL log files having the same info.
I can confirm the values are being populated in the ThreadContext.

Any info or pointers is appreciated.
Thanks!

Re: Problem with ThreadContextMapFilter

Posted by Remko Popma <re...@gmail.com>.
Glad to hear the problem is resolved. 
Enjoy!

Remko 

Sent from my iPhone

> On Jan 25, 2017, at 7:25, kriegerd <kr...@gmail.com> wrote:
> 
> SOLVED.
> 
> 2 dumb issues.
> 1. I was getting a class not found error for the ContextMapFilter, changed
> to ThreadContextMapFilter.
> 
> 2. I had incorrect casing in the values and things were therefore not being
> filtered correctly.
> 
> Thanks either way!
> 
> On Tue, Jan 24, 2017 at 12:35 PM kriegerd <kr...@gmail.com> wrote:
> 
> Hi everyone,
> 
> I'm trying to send messages to different files based on a key/value from
> the current context.
> To do that I set up 3 appenders all children of root with
> different ContextMapFilter.
> 
> My configuration is attached.
> Basically one appender will look for "External" entries, the other appender
> "Internal" and the last one everything else (that's the intention at least).
> 
> What I'm seeing is ALL log files having the same info.
> I can confirm the values are being populated in the ThreadContext.
> 
> Any info or pointers is appreciated.
> Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Problem with ThreadContextMapFilter

Posted by kriegerd <kr...@gmail.com>.
SOLVED.

2 dumb issues.
1. I was getting a class not found error for the ContextMapFilter, changed
to ThreadContextMapFilter.

2. I had incorrect casing in the values and things were therefore not being
filtered correctly.

Thanks either way!

On Tue, Jan 24, 2017 at 12:35 PM kriegerd <kr...@gmail.com> wrote:

Hi everyone,

I'm trying to send messages to different files based on a key/value from
the current context.
To do that I set up 3 appenders all children of root with
different ContextMapFilter.

My configuration is attached.
Basically one appender will look for "External" entries, the other appender
"Internal" and the last one everything else (that's the intention at least).

What I'm seeing is ALL log files having the same info.
I can confirm the values are being populated in the ThreadContext.

Any info or pointers is appreciated.
Thanks!