使用ET的日志模块时,总有一个问题一直困扰着我,就是写入日志的时间不正确。LAB记录的日志里timestamp总是UTC时间,很是郁闷,只能把里面的DateTime.UtcNow改成DateTime.Now,再编译引用。 

后来发现一个很好的格式化的方法,特分享出来

用Enterprise Library Configuration 工具打开配置文件,仅需要修改LAB的Text Formatter节下的Template描叙

Enterprise Library Logging App Block的时区问题

将TimeStamp:{timestamp} 修改为TimeStamp:{timestamp(local)}即可,输出的日志日期即为本地时间了。

相关文章:

  • 2022-12-23
  • 2021-07-31
  • 2022-02-11
  • 2021-07-23
  • 2021-09-25
  • 2021-05-17
  • 2021-05-16
  • 2022-12-23
猜你喜欢
  • 2021-11-24
  • 2021-08-11
  • 2021-06-19
  • 2022-01-18
  • 2022-12-23
  • 2022-01-02
  • 2022-03-09
相关资源
相似解决方案