logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas Duane <nic...@msn.com>
Subject RE: setting or overriding log levels via configuration?
Date Thu, 09 Jul 2015 19:30:58 GMT
Was working on this more and decided I would just attempt to add the <level> element
under the <log4net> element and see what happens.  Luckily there is a "debug" attribute
on the <log4net> element which gives you an indication of what log4net is doing so I
also turned that on.  It seems to work not only based on the debug log4net statements I saw
generated, but the test results also confirmed it's working.  Well let me restate that.  What
I added was the following:

    <name value="Warn"/>
    <value value="2147483647"/>
    <name value="Info"/>
    <value value="2147483647"/>
    <name value="Error"/>
    <value value="2147483647"/>

I did this because I wanted to see if I could make it such that Error, Warn and Info logs
could not be turned off.  And it appears this accomplishes that.

I still have a question.  If I want to add a new level is there a way to specify the "display
name" of that level in configuration?


From: nickdu@msn.com
To: log4net-user@logging.apache.org
Subject: setting or overriding log levels via configuration?
Date: Wed, 8 Jul 2015 22:29:16 -0400


Is there a way to set custom log levels via configuration?

Is there a way to change existing log levels via configuration?

At the end of this post http://stackoverflow.com/questions/538095/how-do-i-filter-on-a-custom-level-in-log4net
I see someone had said:

"You will need to add

  <name value="AUDIT" />
  <value value="35000" />

in your log4net config section."

which lead me to believe specifying custom log levels in configuration is possible.  However
after searching for a while I have seen no other reference to something similar.


View raw message