Re: logging level per thread

2015-02-18 Thread Ralph Goers
Yes.  “Normal” logging only checks the level, which is an integer value and can 
be done very quickly.  Filters are typically more involved and so have more 
overhead. That said, it may not be significant in your application.

RAlph

> On Feb 18, 2015, at 9:15 AM, Mark Lybarger  wrote:
> 
> This is the filter i need. Is there a performance hit to using the filters?
> On Feb 17, 2015 5:24 PM, "Ralph Goers"  wrote:
> 
>> I apologize. I pointed you at the wrong filter. The one you want is the
>> DynamicThresholdFilter -
>> http://logging.apache.org/log4j/2.x/manual/filters.html#DynamicThresholdFilter
>> <
>> http://logging.apache.org/log4j/2.x/manual/filters.html#DynamicThresholdFilter
>>> .
>> 
>> Ralph
>> 
>>> On Feb 17, 2015, at 12:04 PM, Mark Lybarger  wrote:
>>> 
>>> thanks for the reply.  i'm looking into the ThreadContextMapFilter, and
>> it
>>> seems very interesting.  I don't quite see how i apply a logging level to
>>> the particular filter match?
>>> 
>>> 
>>> 
>>>   
>>> 
>>> 
>>> from what i read, this looks into the thread context map, and if the
>>> current thread had issued the command:
>>> ThreadContext.put("debugUser","DEBUG"), then the log messages would pass
>>> the filter.  That's fantastic, however, I need to specify a level as
>> well.
>>> It looks like I want/need a combination of the ThreadContextMapFilter and
>>> the ThresholdFilter.  A ThreadContextMapThresholdFilter perhaps?
>>> 
>>> 
>>> 
>>> On Fri, Feb 13, 2015 at 11:39 AM, Ralph Goers <
>> ralph.go...@dslextreme.com>
>>> wrote:
>>> 
 See http://logging.apache.org/log4j/2.x/manual/eventlogging.html <
 http://logging.apache.org/log4j/2.x/manual/eventlogging.html>.  You
>> would
 then use
 
>> http://logging.apache.org/log4j/2.x/manual/filters.html#ThreadContextMapFilter
 <
 
>> http://logging.apache.org/log4j/2.x/manual/filters.html#ThreadContextMapFilter
>>> 
 to set the desired log level for the user.
 
 Ralph
 
> On Feb 13, 2015, at 8:33 AM, Mark Lybarger 
>> wrote:
> 
> I have a j2ee application that i'd like to change the logging level on
>> a
> per thread or a per context basis.  For intstance, I'd like to enable
 debug
> level for user FOO.  Has anyone encountered this ?
> 
> Thanks,
> -mark-
 
 
>> 
>> 


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



Re: logging level per thread

2015-02-18 Thread Mark Lybarger
This is the filter i need. Is there a performance hit to using the filters?
On Feb 17, 2015 5:24 PM, "Ralph Goers"  wrote:

> I apologize. I pointed you at the wrong filter. The one you want is the
> DynamicThresholdFilter -
> http://logging.apache.org/log4j/2.x/manual/filters.html#DynamicThresholdFilter
> <
> http://logging.apache.org/log4j/2.x/manual/filters.html#DynamicThresholdFilter
> >.
>
> Ralph
>
> > On Feb 17, 2015, at 12:04 PM, Mark Lybarger  wrote:
> >
> > thanks for the reply.  i'm looking into the ThreadContextMapFilter, and
> it
> > seems very interesting.  I don't quite see how i apply a logging level to
> > the particular filter match?
> >
> >
> >  
> >
> >  
> >
> > from what i read, this looks into the thread context map, and if the
> > current thread had issued the command:
> > ThreadContext.put("debugUser","DEBUG"), then the log messages would pass
> > the filter.  That's fantastic, however, I need to specify a level as
> well.
> > It looks like I want/need a combination of the ThreadContextMapFilter and
> > the ThresholdFilter.  A ThreadContextMapThresholdFilter perhaps?
> >
> >
> >
> > On Fri, Feb 13, 2015 at 11:39 AM, Ralph Goers <
> ralph.go...@dslextreme.com>
> > wrote:
> >
> >> See http://logging.apache.org/log4j/2.x/manual/eventlogging.html <
> >> http://logging.apache.org/log4j/2.x/manual/eventlogging.html>.  You
> would
> >> then use
> >>
> http://logging.apache.org/log4j/2.x/manual/filters.html#ThreadContextMapFilter
> >> <
> >>
> http://logging.apache.org/log4j/2.x/manual/filters.html#ThreadContextMapFilter
> >
> >> to set the desired log level for the user.
> >>
> >> Ralph
> >>
> >>> On Feb 13, 2015, at 8:33 AM, Mark Lybarger 
> wrote:
> >>>
> >>> I have a j2ee application that i'd like to change the logging level on
> a
> >>> per thread or a per context basis.  For intstance, I'd like to enable
> >> debug
> >>> level for user FOO.  Has anyone encountered this ?
> >>>
> >>> Thanks,
> >>> -mark-
> >>
> >>
>
>