Anonymous Asked in Cars &Transportation · 2 weeks ago

Should I log to database or file?

In hindsight, a better answer is to log to BOTH file system (first, immediately) and then to a centralized database (even if delayed). Most modern logging frameworks follow a publish-subscribe model (often called logging sources and sinks) which will allow multiple logging sinks (targets) to be defined. 6 нояб. 2011 г.


Is it better to log to file or database?

In very general terms, logging to a text file is much faster than logging to a database. That's the main aspect of logging you need to consider.

Is it good to store log in database?

There's nothing inherently right or wrong with logging to a database versus logging to a file; it all depends on your needs. Think through your needs, then decide. Logging to a database is very convenient when debugging, but it might require more of you, your team or your application in the long run.

Should you write logs to a database?

The bottom line is that DB logging will slowly kill your operational DB performance; your DB response times will grow, and may become unreliable since they will have to wait for resources — most frequently, disk I/O. Mixing your read heavy operational DB with a write heavy logging is not a good idea.

What is the difference between data file and log file?

Data files contain data and objects such as tables, indexes, stored procedures, and views. Log files contain the information that is required to recover all transactions in the database.

Related Questions

Relevance
Write us your question, the answer will be received in 24 hours