?
Solved

Best practice for Enterprise Library Logging

Posted on 2008-02-10
7
Medium Priority
?
471 Views
Last Modified: 2008-03-06
can someone tell me what the best practices are for enterprise library logging?  namely, where and when to put logging blocks?  thanks.
0
Comment
Question by:mmingfeilam
  • 3
  • 2
  • 2
7 Comments
 
LVL 12

Accepted Solution

by:
ShazbotOK earned 900 total points
ID: 20866475
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
 
LVL 30

Expert Comment

by:anarki_jimbel
ID: 20869827
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
 

Author Comment

by:mmingfeilam
ID: 20890275
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 30

Expert Comment

by:anarki_jimbel
ID: 20890461
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
 

Author Comment

by:mmingfeilam
ID: 20895612
do you know what the main differences are between enterprise library and log4net?
0
 

Author Comment

by:mmingfeilam
ID: 20896071
also, assuming it's possible, does anyone know of any concrete examples of how these classes can be inherited?  thanks.
0
 
LVL 12

Assisted Solution

by:ShazbotOK
ShazbotOK earned 900 total points
ID: 20902211
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

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…
Suggested Courses

594 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question