Is it better to log to file or database?

前端 未结 5 1021
醉梦人生
醉梦人生 2021-01-30 22:21

We\'re still using old Classic ASP and want to log whenever a user does something in our application. We\'ll write a generic subroutine to take in the details we want to log.

5条回答
  •  醉话见心
    2021-01-30 23:05

    Either works. It's up to your preference.

    We have one central database where ALL of our apps log their error messages. Every app we write is set up in a table with a unique ID, and the error log table contains a foreign key reference to the AppId.

    This has been a HUGE bonus for us in giving us one place to monitor errors. We had done it as a file system or by sending emails to a monitored inbox in the past, but we were able to create a fairly nice web app for interacting with the error logs. We have different error levels, and we have an "acknowledged" flag field, so we have a page where we can view unacknowledged events by severity, etc.,

提交回复
热议问题