Support for defining custom levels during configuration was added in 1.2.9 http://logging.apache.org/log4net/downloads.html
Nicko > -----Original Message----- > From: Simon Wallis [mailto:[EMAIL PROTECTED] > Sent: 06 September 2005 15:24 > To: Log4NET User > Subject: RE: custom logging level > > Hi Nicko, > > When I add that to my log4net.config I get this error in DebugView: > > [1864] log4net:ERROR DOMConfigurator: Cannot find Property > [level] to set object on [log4net.Repository.Hierarchy.Hierarchy] > > I'm using log4net v1.2.8 ... is the configuring of custom > levels not supported in this version?? :( > > Simon. > > > ---------- Original Message ---------------------------------- > From: "Nicko Cadell" <[EMAIL PROTECTED]> > Reply-To: "Log4NET User" <[email protected]> > Date: Sat, 3 Sep 2005 11:50:23 +0100 > > > > >If you want to use your custom level name in the config file > then you > >need to define the level in the config file. Add the > following to the > >top of your <log4net> section: > > > ><level> > > <name value="ACTIVITY" /> > > <value value="40000" /> > ></level> > > > >Then you can use the ACTIVITY level in your config file. > > > >Cheers, > >Nicko > > > >> -----Original Message----- > >> From: Simon Wallis [mailto:[EMAIL PROTECTED] > >> Sent: 02 September 2005 22:43 > >> To: [email protected] > >> Subject: custom logging level > >> > >> Hi, I want to add a new custom logging level, called ACTIVITY, to > >> record user activity. It can have the same level as INFO, > but it must > >> have its own name so that it's easily distinguishable and so I can > >> record ACTIVITY events to a separate log file. > >> > >> Since the log4net Level class is sealed, I cannot override > it in my > >> log4netExtensions project. Therefore, in my LogExtImpl > class where I > >> implement various Activity() methods and > IsActivityEnabled(), I have > >> a private variable like this: > >> > >> private Level ACTIVITY = new Level(Level.INFO.Value, "ACTIVITY"); > >> > >> If I do this, however, the configuration will not understand any > >> references to a level of "ACTIVITY". It will successfully log > >> ACTIVITY events along with INFO events, but I cannot > handle ACTIVITY > >> events in any special way since the config does not know > about this > >> level. > >> > >> I also implemented a custom log level called TRACE, but > this worked > >> fine since it already exists in the Level class, and my Trace() > >> methods in LogExtImpl can reference that (as the example > code in the > >> distribution demonstrates). > >> > >> So how can I accomplish what I'm trying to do with a > custom log level > >> that doesn't exist in the Level class?? > >> > >> Thanks, > >> Simon. > >> > >> > >> > >> > >> ________________________________________________________________ > >> Sent via the WebMail system at wallis.ca > >> > >> > >> > >> > >> > >> > > > > > > > > ________________________________________________________________ > Sent via the WebMail system at wallis.ca > > > > >
