DB Audit Trail 的最佳实施是什么?

发布于 2024-07-04 09:59:33 字数 1452 浏览 4 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

北风几吹夏 2024-07-11 09:59:34

我完全支持@IainMH(并投票给了他)。

您希望将其包含在 DAL 中,并且最好与某种切面/拦截器/代码注入机制相关联。

I totally second @IainMH (and voted him up).

You want to have it in your DAL and ideally tied to some kind of aspect/interceptor/code injection mechanism.

黎歌 2024-07-11 09:59:34

+2 用于实施何时/如何在 DAL 中进行审核。

至于审计条目本身应该存放在哪里,这取决于它的可见方式。 如果用户可以查看单独的“审核跟踪报告”,我会创建一个单独的表,但如果您想内联显示最后修改类型的审核,则标记现有表。

+2 for implementation of when/how to audit in the DAL.

As for where the audit entries themselves should live, it depends on how it will be visible. I'd do a separate table if users can view a separate "audit trail report," but tag existing tables if you want to display last modified-type audits inline.

じ违心 2024-07-11 09:59:33

根据您正在执行的操作,您可能希望将审核从数据层移至数据访问层。 它给你更多的控制权。

我在这里问了关于 NHibernate 和 SqlServer 的类似问题。

Depending on what you're doing, you might want to move the audit out of the data layer into the data access layer. It give you more control.

I asked a similar question wrt NHibernate and SqlServer here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文