We have a web farm with reliable logging, and here is how it is implemented.
Each web application generates logging events. Using MSMQ, these messages are sent to a private queue located on a separate machine. There is an application on this computer that cancels messages and writes them to the Sqlite database.
Using MSMQ separates the web application from the log server. If the server is not connected, messages are posted on the web server until the connection is restored. MSMQ handles message transfer to the destination server. In this way, the website can continue to do its work without interruption.
The log server has its own web interface for querying the logging database and can also receive log messages from other applications.
We assign a classification to each message. For messages with fatal error classification, the log server automatically generates an email to the support service. Other non-fatal messages and trace messages are only written to the database for summary reporting.
Joel Provost
source share