开发者

Custom Logging for ServiceSecurityAuditBehavior in WCF 4.0?

开发者 https://www.devze.com 2023-04-07 09:26 出处:网络
On my server, I would like to log security information to a databas开发者_C百科e instead of the Windows Application or Security log. I am trying to figure out how to override or customize the ServiceS

On my server, I would like to log security information to a databas开发者_C百科e instead of the Windows Application or Security log. I am trying to figure out how to override or customize the ServiceSecurityAuditBehavior stuff to not just write to a Windows log. Is that possible?

Thanks.


You will not achieve that through ServiceSecurityAuditBehavior. This behavior doesn't add audit feature. The feature itself is hardcoded in DispatchRuntime and this behavior only expose its configuration.

I think the default WCF implementation doesn't offer any hook to change audit mechanism because all classes using this auditing are internal and expect writing to event log and I'm not sure how big change you need to do to allow custom audit - default audit is handled during authentication, authorization and impersonation. You will have to hook or rewrite all of them.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号