I've got a .NET Windows application that's deployed via ClickOnce to a Web server. There are approximately 100 users at any given time, all centrally located. I'm using log4net to log within the application, but I'm having trouble arriving at the best place to put the log.
I've tried having them write to a shared network location, but some users have experienced poor I/O with that approach. I've tried logging to the user's temp folder, but that makes it harder to retrieve the logs. I haven't tried the event log because I will probably have to jump through some hoops to get that working, and I'm not sure if it's worth it. I've never tried database logging, but I've always assumed that it would be relatively slow.
Does anybody have experience with logging in a Windows application deployed in a corporate environment? Any suggestions on where I can put the log so that it will be (1) quick, (2) reliable, and (3) accessible?
The problem with Database logging isn't the speed: it's the reliability. You log for when things go wrong, and if something's going wrong already the odds of an inaccessible DB aren't in your favor.
Generally, you want to write to a local text file and somewhere else like a network share or DB. If you're having IO/speed problems you can use the text file as a buffer and write logs to the contended resource in batches. Then you periodically flush the local 'backup' logs.
I've used log4net with ms sql databases. I generally put them a dedicated db, on a different server, if possible. That way if there are problems with the application server or db, I don't lose my logging.
Speed was never an issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With