Using Logging Application Block In N-Tier

Topics: Logging Application Block
Feb 19, 2011 at 11:55 AM

Can you please let me know the best way to use the LAB in n-tier.

Feb 21, 2011 at 2:25 AM

LAB already encapsulates most of the best practices for logging.  In addition, you can implement it in an AOP-like approach by using Unity or Policy Injection which are also available in Enterprise Library.

Or is you're question more on where to do logging in an N-Tier application, am I right?  IMHO, logs should generally be present on the client-side providing enough information to the user.  Logging on the data access layer which is probably on a different machine isn't also bad and it really depends on the requirement. 

Log message should provide enough information to those who are expected to have access to it.  Enough meaning it contains only the necessary information the user needs to know.  Provide a good format as well so it's easy to read.  Have different logging categories and give each an appropriate name depending on how you differentiate each.  Try also looking up for general logging best practices,  I could help you out more if you have specific things you want to implement using LAB.


Sarah Urmeneta
Global Technologies and Solutions
Avanade, Inc.