Custom database trace listener

Topics: Logging Application Block
Dec 15, 2009 at 5:09 PM

Hi All,

Problem statement:

I am trying to Log into a specified table(newly created for logging) in the database about the time taken for execution of a method call. This method would be called after regular intervals(Every 30 Seconds or so).  I am intersted to log only the time taken for the execution of a method onto this table. I am new to enterprise logging. I understand that I should create a custom database listener wherein I would be pointing to the SP to be called and all. I would also need to add extended properties to log non trace properties. I am not getting a good material on the same on the net. Can someone share some examples if they have already tried out such things. Also let me know if a logger be used for such a purpose.  Quick answer will be appreciated.  

 

Thanks in Advance,

Vijay1900

Dec 16, 2009 at 3:43 AM

Hi,

We could send you a sample solution of a custom database trace listener. Just hit us a mail and we'll send back the solution.

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

Dec 16, 2009 at 5:24 AM

Thanks Valiant. I have sent a mail to you.

Valiant,

I have a doubt. How efficient is Enterprise Library(LAB) when I think of performing the same operation using a query from the application side. As stated above in my problem statement, I am interested to create a new table to which I would be inserting the records(Which is the time taken for execution of some method).

Q1: Does the enterpise logging use the same thread as application does? Or it runs on a seperate thread?

Q2: Which option is faster(Inserting the record through logger/ Through application for the intended operation)?

Thanks,

 

Dec 17, 2009 at 3:21 AM

Q1:Does the enterpise logging use the same thread as application does? Or it runs on a seperate thread?

A: It uses the same thread.  You can do asynchronous logging through the MSMQ trace listener.

 

Q2: Which option is faster(Inserting the record through logger/ Through application for the intended operation)?

A:   I can't say as I don't know how efficient your own logging application will be. you'll have to do the performance testing.  But I suggest you do the testing first for the LAB and see if the performance is acceptable to you so you won't need to rewrite a new logging API.

 

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