Dear Lazyweb,
We use log4net as a logging mechanism for a high performance transactional system extensively, but the problem we’ve been having lately is that the log files are often spread accross multiple clustered machines.
Is there a simple way to get performant centralized logging using log4net accross a clustered web server environment?
Update: Not sure if it’s quite a simple way to go, but this has definitely already been done using a RemotingAppender and corresponding sink.
Beside logging to the database I’m presuming? What about installing a windows syslog service and logging to that. Then you’d get file logging, which is nicer to grok than the db stuff, and it would be centralized. Beware that you need to be careful about how you logging code works, we had trouble when our logging db started timing out. Imagine logging that you’re about to perform the db transaction, the log4net take 30 seconds to timeout connecting to the syslog server (or db). Bad News .
The problem with logging to the db, is that log4net seems to perform very poorly using ADO.net.
I’ve been considering using one of other connectors (say UDP connector) to send the log messages to a service somewhere on the network which then queues them up (possibly using MSMQ), to then get processed into whatever central system (DB, event log or file) that makes the most sense.
Though the ideal solution would involve me not having to write custom logging code.
“File loggin nicer to crep grok than db” is a debatable opinion, also, is the windows syslog slower than file logging in log4net, or the same speed?