Viewing Log Files

Topics: Logging Application Block
Feb 2, 2009 at 9:47 AM
Hi,

I am using Logger.Write(ex.Message) to log my exceptions. Can anyone help me to find out where the exception message is actually being logged? I am using this for the first time and I am unable to find out where the library actually logs these exceptions. Thanks!!!!
Feb 2, 2009 at 10:09 AM
Edited Feb 2, 2009 at 10:41 AM
It won't get logged because you didn't specify the category to use.  You can use this, Logger.Write(ex.Message, "General").  The "General" category by default is added when you add the Logging Application Block.  The General category contains the FormattedEventLog TraceListener which is designed to log in the EventViewer.

EntLib contains other tracelisteners which are designed to log to different locations other than the EventViewer such as to text files, xml files, database, etc. Check out the documentation and quickstarts for more info.


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
Feb 2, 2009 at 12:25 PM
Thanks for your information. Where is this EventLog file be located in the PC? How do i open and see the EventLog file to view the list of all probable exceptions my application could have generated (I write all exceptions to the log). Please help. Thanks!!!!
Thanks & Regards,
Sathya Narayanan

Honeywell
ACS - Life Safety - Fire Systems - Silent Knight
Bangalore, INDIA
Extn: 46685
Success is about turning stones into milestones

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error


From: AvanadeSupport [mailto:notifications@codeplex.com]
Sent: Monday, February 02, 2009 4:40 PM
To: Narayanan, Sathya (IE10)
Subject: Re: Viewing Log Files [entlib:45914]

From: AvanadeSupport

It won't get logged because you didn't specify the category to use. You can use this, Logger.Write(ex.Message, "General"). The "General" category by default is added when you add the Logging Application Block. The General category contains the FormattedEventLog TraceListener which is designed to log in the EventLog.


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
Feb 3, 2009 at 12:24 AM

Hi,

You can open EventLog by Start > Run and type eventvwr, or you Start > Control Panel > Administrative Tools > Event Viewer. Then when it opens, click the "Application" and see if the log is there.


Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com