简体   繁体   English

如何在Catel中自定义日志输出格式?

[英]How to customize log output format in Catel?

We're using Catel 3.9 and FileLogListener . 我们正在使用Catel 3.9和FileLogListener However the log format doesn't contain date nor thread id. 但是,日志格式不包含日期或线程ID。 Also the time format is in 12h and not 24h. 时间格式也是12h,而不是24h。

I couldn't find any way to customize the log format like in log4net. 我找不到像log4net一样自定义日志格式的任何方法。 Is it possible or do I need to implement my own FileLogListener ? 有可能还是需要实现自己的FileLogListener

This is all fixed in Catel 4+. 这在Catel 4+中已全部修复。 For customization options available in 4+, check out the latest docs . 有关4+中可用的自定义选项,请查看最新文档

If you want to fix this in 3.9, you can override FileLogListener and customize the FormatLogEvent method or even implement your own LogListener (deriving from LogListenerBase ). 如果要在3.9中修复此问题,则可以重写FileLogListener并自定义FormatLogEvent方法,甚至可以实现自己的LogListener (从LogListenerBase )。

If you are looking for documentation of older versions, please see the version specific documentation . 如果您要查找旧版本的文档,请参阅特定版本的文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM