I'm writing a static class for logging to be used across my developed solution. There are several components that will use it such as a console application, ASP.NET application, etc...
For the logging to work, it needs to do some initial startup configuration before it can be used, and also some clean up when each application has finished.
Is there a way to do this in .NET without having to expicitly call a StartLog() and FinishLog() method from each application in the solution? Or perhaps a different way of looking at this entirely?
I've been thinking about using locks in each Log() method to check whether the logging class has been initialised, however the potential overhead both in performance and complexity scares me.