retrieve logs from the database

Topics: Logging Application Block
May 17, 2009 at 12:08 PM

I am using Enterprise library 3.1. I am writing the logs to the database using logger.write method. Everything is ok. Now I want these logs to be displayed to a webform. How can I do that?

May 18, 2009 at 2:31 AM

Are you asking if there's a feature in entlib that directly retrieve logs from db?  If so, the answer would be no.  You can just use DAAB for ease of performing CRUD operations on database.

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.

entlib.support@avanade.com

May 18, 2009 at 4:30 AM

I dont understand what you mean by directly retrieving logs from database?. The basic purpose of logging is to record what is happening in the system. So somebody needs to monitor it...So I should have a page where I list all the logs. How can I do that.. using DAAB, I need to look in to the log db structure, that I dont want to do..... That is the reason I am using logging Application block... please help

May 18, 2009 at 5:34 AM

I just meant to ask if you want to display those messages by retrieving them from the database or by some other means, display them without reading those which have just been log to the db.  I assumed the first one was the case since that was in the title.  The second one I think you can achieve by creating a custom tracelistener that writes to your page.

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.

entlib.support@avanade.com

May 19, 2009 at 7:13 AM

Sorry for the confusion. Your first assumption is correct, I want to display the logs that already stored in the database. I need to access the extended properties in each log and display to the user. Is there any default mechanism available. if not what is the best way for me to do the retrieval?

May 19, 2009 at 7:57 AM

Hi,

There is not built in mechanism that comes with Logging Application Block(with the scripts provided). What you can do is to create a stored procedure that will retrieve the logs and use the Data Access Application Block to do data access.

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.

entlib.support@avanade.com