Sql Server as logging, best connection practise
- by ozz
I'm using SqlServer as logging. Yes this is wrong decision, there are better dbs for this requirement. But I have no other option for now.
Logging interval is 3 logs per second.
So I've static Logger class and it has static Log method.
Using "Open Connection" as static member is better for performance. But what is the best implemantation of it?
This is not that I know.
public static class OzzLogger
{
static SqlConnection Con;
static OzzLogger()
{
Con=ne SqlConnection(....);
Con.Open();
}
public static void Log(....)
{
Con.ExecuteSql(......);
}
}
UPDATE
I asked because of my old information. People say "connection pooling performance is enough". If there is no objection I'm closing the issue :)