Last post Jun 23, 2008 11:23 PM by anup_daware
Member
19 Points
22 Posts
Jun 06, 2008 12:19 PM|rboin.dock|LINK
Hi,
Is it possible to have Asynchronous logging using LAB?
I also wanted to know the advantages of LAB over Log4Net.
Or should I go for writing my own asynchronous logger?
Please Help,
Robin
Contributor
2062 Points
555 Posts
Jun 09, 2008 12:49 AM|anup_daware|LINK
rboin.dock Is it possible to have Asynchronous logging using LAB?
NO the LAB is not Asynchronous by default. But you can make it Asynchronous using MSMQ
rboin.dock I also wanted to know the advantages of LAB over Log4Net.
LAB is one of the most complex application block articture wise. it supports many listeners and it is highly configurable.
And advantage over the the Log4Net: May be because it is Microsoft Initative :)
rboin.dock should I go for writing my own asynchronous logger?
Following post will give you more info as well as some useful links:
http://forums.asp.net/p/1117624/1736413.aspx#1736413
Hope this helps,
Thanks,
Anup
Always remember to click 'Mark as Answer' on the post that helps you.
Jun 09, 2008 01:06 AM|rboin.dock|LINK
Hi Anup,
Thank you very mukch for this, you answered all the questions!
Best Regards,
Rob
Jun 20, 2008 06:17 AM|rboin.dock|LINK
Can you please give me some pointers on how to make my logger asynchronous?
Jun 20, 2008 06:28 AM|rboin.dock|LINK
Jun 20, 2008 06:39 AM|anup_daware|LINK
Hi Rob,
Few Suggestions:
1. Make the logger class singleton
2. Keep a queue of log messages in Logger class
3. Current threads will just add the records to the queue and will not do actual I/O operation (so performance is assured)
4. Run a separate thread in Logger class which will periodically access the queue and to log the messages in file or whatever the destination is.
You have to be very careful about the race and deadlocks in this case. Thus may have to do proper synchronization
Jun 20, 2008 06:45 AM|rboin.dock|LINK
Thanks for these valuable suggestions. Could you please forward me some good link to start on threading?
Regards,
Jun 23, 2008 11:23 PM|anup_daware|LINK
Following is the best book on threading
Threading in C# by Joseph Albahari
http://geekswithblogs.net/ram/archive/2006/06/16/82078.aspx
Hope this helps
Member
19 Points
22 Posts
Asynchronous logging using logging application block
Jun 06, 2008 12:19 PM|rboin.dock|LINK
Hi,
Is it possible to have Asynchronous logging using LAB?
I also wanted to know the advantages of LAB over Log4Net.
Or should I go for writing my own asynchronous logger?
Please Help,
Robin
Contributor
2062 Points
555 Posts
Re: Asynchronous logging using logging application block
Jun 09, 2008 12:49 AM|anup_daware|LINK
Hi,
NO the LAB is not Asynchronous by default. But you can make it Asynchronous using MSMQ
LAB is one of the most complex application block articture wise. it supports many listeners and it is highly configurable.
And advantage over the the Log4Net: May be because it is Microsoft Initative :)
Yes, if you want a lightweight logger, which only logs to a file or event logger, then go for writing your own Asynchronous logger.
Following post will give you more info as well as some useful links:
http://forums.asp.net/p/1117624/1736413.aspx#1736413
Hope this helps,
Thanks,
Anup
Always remember to click 'Mark as Answer' on the post that helps you.
Member
19 Points
22 Posts
Re: Asynchronous logging using logging application block
Jun 09, 2008 01:06 AM|rboin.dock|LINK
Hi Anup,
Thank you very mukch for this, you answered all the questions!
Best Regards,
Rob
Member
19 Points
22 Posts
Re: Asynchronous logging using logging application block
Jun 20, 2008 06:17 AM|rboin.dock|LINK
Hi Anup,
Can you please give me some pointers on how to make my logger asynchronous?
Thanks,
Rob
Member
19 Points
22 Posts
Re: Asynchronous logging using logging application block
Jun 20, 2008 06:28 AM|rboin.dock|LINK
Hi Anup,
Can you please give me some pointers on how to make my logger asynchronous?
Thanks,
Rob
Contributor
2062 Points
555 Posts
Re: Asynchronous logging using logging application block
Jun 20, 2008 06:39 AM|anup_daware|LINK
Hi Rob,
Few Suggestions:
1. Make the logger class singleton
2. Keep a queue of log messages in Logger class
3. Current threads will just add the records to the queue and will not do actual I/O operation (so performance is assured)
4. Run a separate thread in Logger class which will periodically access the queue and to log the messages in file or whatever the destination is.
You have to be very careful about the race and deadlocks in this case. Thus may have to do proper synchronization
Thanks,
Anup
Member
19 Points
22 Posts
Re: Asynchronous logging using logging application block
Jun 20, 2008 06:45 AM|rboin.dock|LINK
Hi Anup,
Thanks for these valuable suggestions. Could you please forward me some good link to start on threading?
Regards,
Rob
Contributor
2062 Points
555 Posts
Re: Asynchronous logging using logging application block
Jun 23, 2008 11:23 PM|anup_daware|LINK
Hi Rob,
Following is the best book on threading
Threading in C# by Joseph Albahari
http://geekswithblogs.net/ram/archive/2006/06/16/82078.aspx
Hope this helps
Thanks,
Anup