Coo
Coo

Reputation: 1882

Log4net database vs file log

I'm wondering what will work better performance wise and size wise. I'm using log4net for logging, and I'm considering either writing it to a file (with the possibility of creating new files every 10 MB or something) or writing to a database. Which is faster and which will grow more in size?

Assume the total amount of log messages will be at least 15 million, to tops 30M. The log medium (DB/file) will likely be on the same disk where other stuff is happening, so shorter write times are better.

Upvotes: 0

Views: 604

Answers (1)

to StackOverflow
to StackOverflow

Reputation: 124726

Writing to a file will be faster and smaller, especially if FileAppender.ImmediateFlush is false (which is the default). You don't have the overhead of writing to a transaction log, commiting changes etc that you would have with a database.

OTOH, of course, you won't have the querying capabilities that a database can provide.

Upvotes: 1

Related Questions