I have a BIG client-serve application that uses Enterprise Library v4.0
It uses the Enterprise Library logger each time when there is a new connection to the DB.
When I shut down the logger (by using comments or my on/off boolean in the web.config and app.config) batch operations (e.g. requesting 100 records) it takes about 6-7 seconds. When I put the logger on, it takes about 20 seconds.
My question is how exactly the Enterprise Library operates the logger, Is it by using threads or not? How exactly can I tell?
I’m asking this question because I would like to call the logger using threads but if the library already uses threads, it will not be successful. Also, is using threads preferable for this operation? Do you think I need to use other logger, e.g Log4Net and such?
The Enterprise Library Logger handles requests synchronously so it is not spawning threads to process write requests.
If you want to see what threads are being created, then you can monitor the threads in Visual Studio while debugging.
Your application could always start a thread to log the information but I would be vigilant in determining if starting potentially a large number of short lived threads actually helps performance.
I would recommend profiling to determine what is taking all the time.