|
I am not a log4net expert... so please consult others too and do your
own investigation. :: Category vs. log4net filtering - Category is a flat filter rule. log4net hierarchy is much more powerful. for additional filtering on other attributes, add info to the properties and/or stacks and filter on them. - Only use named properties where they are globally relevant as you have to type them verbatim into your configs. - Use a generic property bag otherwise, eg Property{Tags} rather than Property{TagA} + Property{TagB} Important notes: - for adding custom properties and stacks that are simple data, not thread-state etc, you must avoid using the ThreadContext approach even though it is the obvious first attempt. It is incredibly slow. eg 10K logs/second rather than say 1million logs/second. rather, use a wrapper that performs log.Logger.Log( manualLogEvent). - also, follow the pattern of creating a static Logger instance once per unit (and their recommendation of one per class seems sound and that is what I am using). it is far too expensive to instantiate a Logger for every log() call. I personally have my own wrapper object that includes a Logger instance and I create a static one of those per code class. I am budgeting about 100bytes per instance at, say, 10K classes max for 1MB working set usage. I'm not sure if this is accurate. - use Text or Property filters to perform filtering on your custom property :: MSMQ I don't currently have a need for MSMQ appender. I expect someone already has made it. If the EntLib one is not too tricky, you would be able to reproduce it quickly by extending AppenderSkeleton. :: Async Log4net is synchronous too. I'm not sure if there is asynch for normal targets. hope it helps, Mike. shaeney wrote: OK, that very good information. I see that the MS Logging Application Block (LAB) allows messages to be routed based on "Category" and each message contains a collection of name-value pairs of meta data.What is the corresponding Log4Net technology? From what little I have seen, messages are routed based on Class Type? I think that LAB is synchronous by default, with asnyc comms achieved via MSMQ, but Log4Net is async by default? Cheers, Steve Mike Liddell wrote: |
- Newbie: Log4Net or MS Logging Application Block? shaeney
- RE: Newbie: Log4Net or MS Logging Application Bloc... Walden H. Leverich
- Re: Newbie: Log4Net or MS Logging Application Bloc... Mike Liddell
- Re: Newbie: Log4Net or MS Logging Application ... shaeney
- Re: Newbie: Log4Net or MS Logging Applicat... Mike Liddell
- Re: Newbie: Log4Net or MS Logging Appl... shaeney
- RE: Newbie: Log4Net or MS Logging Appl... Walden H. Leverich
- Re: Newbie: Log4Net or MS Logging... Mike Liddell
- Re: Newbie: Log4Net or MS Logging Application ... Peter Drier
- Re: Newbie: Log4Net or MS Logging Application Bloc... [EMAIL PROTECTED]
- Re: Newbie: Log4Net or MS Logging Application ... shaeney
- Re: Newbie: Log4Net or MS Logging Applicat... Peter Drier
- RE: Newbie: Log4Net or MS Logging Appl... Owen Corpening
- Re: Newbie: Log4Net or MS Logging... Michael Schall
