logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brown, Michael A" <...@purdue.edu>
Subject RE: How to use a custom level in logger interface...
Date Wed, 08 Apr 2015 02:56:38 GMT
Been a while since I've looked at this, but I think there is a Log() function which takes a
level parameter in addition to the parameters you'd pass to Error(). Error() and related methods
are just wrappers for Log() that add the appropriate level parameter. So try using Log() and
passing in your custom level.
________________________________________
From: karlkras [karlkras@yahoo.com]
Sent: Tuesday, April 07, 2015 19:13
To: log4net-user@logging.apache.org
Subject: How to use a custom level in logger interface...

So I've found a sample that states to add a custom level to the log4net xml
configuration as such:
        <log4net>
            <level>
                <name value="AUDIT" />
                <value value="80000" />
            </level>

and I'm guessing I can define my logger to use it like this:

...
                <logger name="RollingFile" additivity="False">
                        <level value="AUDIT"/>
                </logger>

in in the C# code, how do I specify to call the logger to call the logger
with the "AUDIT" level? e.g., for an Error level message I perform an
log4net.ILog.Error(...) call.

what do I do for the custom level since this support isn't built in, i.e.,
how/where do I inject the handlers for interact with the log4net process?

thanks...



--
View this message in context: http://apache-logging.6191.n7.nabble.com/How-to-use-a-custom-level-in-logger-interface-tp54520.html
Sent from the Log4net - Users mailing list archive at Nabble.com.

Mime
View raw message