Nicholas,

Yes, please see
https://logging.apache.org/log4j/2.x/manual/customloglevels.html

If the documentation can be improved, please let us know how.

Gary

On Tue, Aug 25, 2015 at 12:42 PM, Nicholas Duane <nic...@msn.com> wrote:

> Can existing log4j2 levels be redefined?  I'm able to do this in log4net.
> I have yet to see any documentation telling me that I can do it, however,
> there was none telling me I could do it for .NET either.  I just happen to
> stumble upon a post which eluded to it.  Here is what I've done in a
> log4net config file:
>
> <configuration>
>    .
>    .
>    .
>    <log4net>
>       <level>
>          <name value="Off"/>
>          <value value="40000"/>
>       <level>
>       <level>
>          <name value="Business"/>
>          <value value="130000"/>
>       <level>
>       .
>       .
>       .
>    </log4net>
>    .
>    .
>    .
> </configuration>
>
> As you can see I created my own 'Business' level.  I also redefined Off to
> 40000 which happens to be the INFO level.  This makes it such that if they
> set the level to Off they will still receive INFO and higher level events.
>
> Can the same thing be done in log4j2?
>
> Thanks,
> Nick
>




-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Reply via email to