Is writing server log files to a database a good idea?

后端 未结 6 1957
臣服心动
臣服心动 2020-12-02 10:44

After reading an article about the subject from O\'Reilly, I wanted to ask Stack Overflow for their thoughts on the matter.

6条回答
  •  遥遥无期
    2020-12-02 10:58

    Write locally to disk, then batch insert to the database periodically (e.g. at log rollover time). Do that in a separate, low-priority process. More efficient and more robust...

    (Make sure that your database log table contains a column for "which machine the log event came from" by the way - very handy!)

提交回复
热议问题