I'm working on creating web application, which will host in IIS, which I plan to accept a lot of short time connections. Right now I'm working on error logging, and it turns out that it's not that clear how to do it.
For example my back-end sql server went down and 1000 clients which try to get responses from server each 10 minutes, will flood in the event log of the server 60000 events in 1 hour. Can anyone share his experience on how not to flood the event log on the server?
The code is close to this:
RequestHandler :
try {
SqlConnection con = new SqlConnection(...);
cmd.CommandText = "SELECT TOP FROM Foo WHERE Bar = `"Some`"";
con.Open();
cmd.Connection = con;
// convert data to instance
}
catch (SqlException ex)
{
Logger.WriteErrorEvent(ex)
}
// convert instance to response and send it back.
Thanks, Jenia.