Best practice for Enterprise Library Logging

can someone tell me what the best practices are for enterprise library logging?  namely, where and when to put logging blocks?  thanks.
LVL 1
mmingfeilamAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ShazbotOKCommented:
Really depends on what mode of logging you want to perform... genrally, logging is performed on the following:

A)  Exception messages
B)  Authentication errors
C) Activity tracing (for a flow that needs to be tracked)

I would sugest reading into the Microsoft.Enterprise.Practice.Logging class library for more detail:
http://codeplex.com/entlib
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
anarki_jimbelSenior DeveloperCommented:
Some ideas are given in the article about log4net oackage:

http://www.codeproject.com/KB/trace/log4net_intro2.aspx

and also:
http://www.codeproject.com/KB/trace/log4net_intro.aspx

Very good article on Enterprise library with stuff you might be interested in:

http://www.codeproject.com/KB/architecture/GetLoggingWithEntLib.aspx
0
mmingfeilamAuthor Commented:
can you inherit from the microsoft logging class so you can add your own customization to the logging?  I am think creating an interface with methods such as LogToXML, LogToDb, etc.  and underneath, the implementation will be done with the class that's inherited from the Enterprise Library class(es).  thanks.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

anarki_jimbelSenior DeveloperCommented:
I believe you can. I just had a look at EventLog class - it's not sealed, so one might inherit from it. Didn't check others.

By the way, log4net can log to xml and DB, if I'm not wrong (I don't deal much with logging)
0
mmingfeilamAuthor Commented:
do you know what the main differences are between enterprise library and log4net?
0
mmingfeilamAuthor Commented:
also, assuming it's possible, does anyone know of any concrete examples of how these classes can be inherited?  thanks.
0
ShazbotOKCommented:
log4net is a 3rd party vendor that essentaily created a "custom" trace listener and added a load of "cool" features to the application for keeping it flexible to where the logging would be performed.

IMHO
The MS Enterprise Practices logging library essentialy does the same thing... but with more thought put into its abilities... the differences is that MS made this one and it includes a full suite of patterns and methods for making your life easier.

Once the MS Practices library is installed on production you can then utilize all of its methods without haveing to install new vendor tools.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.