我正在使用Postsharp实现基于AOP的日志记录。我正在关注https://doc.postsharp.net/add-logging,但这并不能囊括所有信息。到目前为止,这是我使用loupe和
GlobalASpects.cs
using PostSharp.Patterns.Diagnostics;
using PostSharp.Extensibility;
[assembly: Log(AttributePriority = 1, AttributeTargetMemberAttributes = MulticastAttributes.Protected | MulticastAttributes.Internal | MulticastAttributes.Public)]
[assembly: Log(AttributePriority = 2, AttributeExclude = true, AttributeTargetMembers = "get_*" )]
Program.cs
然后我有带有示例代码的常规TestController只是为了测试代码。如果我看着Loupe,它会默认记录一些信息*(即使我删除了postharp特定代码,它也会记录一些信息)*
这里的问题是如何使它适用于ASP.net核心webapi,或者默认的postharp日志记录缺少什么?