Logging App block with ASP.NET applications

Topics: Logging Application Block
Apr 29, 2009 at 9:38 AM
Hi

I would like to know the best ussage of Logging Application Block for ASP.NET applications.

Have gone through the exercises provided with Hands on labs with Ent Lib 4.1, but they are all windows based applications.

your input and insight appreciated.
Apr 29, 2009 at 10:29 AM
Hi,

On my opinion, they are basically the same when it comes to usage, The code used to log in the Windows app will also run in ASP.NET. Although, there is a chance that you'll run into troubles with permissions, but it's just minor. Also, you may want to look at this : http://stackoverflow.com/questions/673575/what-are-the-best-practices-for-logging-an-enterprise-application has a section about some tips when logging.

Related thread:
http://entlib.codeplex.com/Thread/View.aspx?ThreadId=52831

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
Apr 29, 2009 at 11:08 AM
Thank you.

But your reply has not answer my Question fully.

I am trying to find out how the Logging Application Block can be used with ASP.NET application where the Web application is hosted on Web Server.

Let me know if you are not clear on my Quesiton.

Thanks,
Apr 30, 2009 at 5:50 AM
Do you have any specific concerns on using LAB with ASP.Net apps?  We're not quite clear on what you're asking about.


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
Apr 30, 2009 at 8:52 AM
Well. I have gone throuh the exercises provided with Hands on Labs with Enterprise Library 4.1

My questions is 'how Logging Application Block can be used with ASP.NET applications'?

Yes, I agree that the code used to log in the Windows app will also run in ASP.NET.

Here is my Question again: how the Logging Application Block can be used with ASP.NET application where the Web application is hosted on Web Server.

Regards
Apr 30, 2009 at 9:26 AM
Is your concern is about the fact that it's gonna be hosted in a web server?  Answering this, you need to make sure that the entlib assemblies also gets deployed to the web server.  And as Valiant have said, you may run into permission issues like permissions on writing to the event log so you have to look out for that.

Or are you asking for what purpose or where can you use LAB in asp.net applications?


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
Apr 30, 2009 at 10:17 AM
Thank you Sarah.

Yes you this is my question as you mentioned: Or are you asking for what purpose or where can you use LAB in asp.net applications?

Apr 30, 2009 at 11:02 AM
The usage and purpose of LAB is not something relevant to whether it is a winform or web app.  LAB is for logging any information or errors you need to keep track of in your application like exceptions, successful operations, etc.

If I still haven't answered your question, answer this then first, what purpose or where do you use LAB in winforms?  


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
May 6, 2009 at 7:39 AM
Hi,

Could you please give me how to configure ASP.NET/WCF to log the entries in a flat file and Windows Event Log?

Thanks
Thanh
May 6, 2009 at 8:41 AM
For a flat file, you would need to add a FlatFile tracelistener; for the windows event log, add a FormattedEventLog tracelistener.  For integration with WCF, the documentation provided a detailed instruction on how to do that.


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com