使用平面文件侦听器和文本格式化程序在企业库日志记录中自定义标记
我是企业库的新手。我们正在尝试使用企业库 5.0 记录我们的应用程序。我们使用日志记录的平面文件侦听器方法和文本格式化程序作为日志消息格式化程序。
我们想要记录所有的方法和方法参数。所以我们正在编写一个自定义方法,它将写入日志条目。
因此,我们希望在 LogEntry 中创建自定义属性,就像其内置属性(如 Message、MachineName 等)一样。即,我们需要 MethodName、Param1 等属性。这样我们就可以从我们的方法中分配其值,并将其写入文本文件。
我们可以在 Message 中执行此操作,但我们正在尝试获取自定义属性。
我在此处找到了解决方案。但我想要消息等属性。
I am new to enterprise library.We are trying to log our application using enterprise library 5.0. We are using flat file listener method of logging and text formatter as log message formatter.
We want to log all our methods and method parameters. So we are writing a custom method and it will write the log entry.
So we want to create custom properties in LogEntry like its built in properties like Message, MachineName etc. ie we want properties like MethodName, Param1 etc. So that we can assign its values from our methods and can be written to the text file.
We can do this in Message, but instead we are trying to get custom properties.
I found a solution here. But I want properties like Message etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论