I'm using Log4Net to write logs to files. Can this serioulsy slow down my application? I know it depends on how much I'm writing away, but let's say that some hundreds of logs can be written per second.
It will slow down your application (obviously) but it depends a lot on your application if the slow down qualifies as "serious". I think you need to let it run and then decide if the performance is acceptable...
Of course it can.
As you already said, it depends on how you write it.
If you are logging to a different hard-drive, things will be better. If you are logging via a message based transport, you will probably be OK.
Yes it can. It is crucial to consider the configuration, so you can configure it to not write that much log and then also not have much overhead.
eg.
if (logger.IsDebugEnabled)
{
logger.DebugFormat("log: {0}", myObject.ToString());
}
This will execute ToString only if needed.
The fact that you need to write the log to the disk when you enabled it - you can't do much against it. But usually it is not useful to write too much log, because nobody will ever read it anyway.
I am not sure regarding the slowness of application.
But i can say that if you are writing hundreds of logs per second and that too into a same file then make sure that thread synchronization is in place because you dont want crashes when multiple threads try to access same file.
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