企业库5.0 - 应用程序日志记录 - 日期时间不正确 [英] Enterprise Library 5.0 - Application Logging - Incorrect DateTime

查看:212
本文介绍了企业库5.0 - 应用程序日志记录 - 日期时间不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Microsoft Enterprise库5.0来应用日志记录我的.net应用程序。

I am using Microsoft Enterprise library 5.0 for application logging of my .net application.

日志正常工作。但问题是正在记录的DateTime与日志消息不正确。时差为6.5小时。

Logging is working properly. But the problem is the DateTime that is being logged along with the logging message is incorrect. There is a time difference of 6.5 hrs.

我如何纠正?

推荐答案

更改您的文本格式化程序(在app.config中)以使用本地服务器时间,否则默认为UTC。

Change your text formatter (in app.config) to use the local server time, otherwise it defaults to UTC.

eg将{timestamp}令牌更改为{timestamp(local)}

e.g. change {timestamp} token to {timestamp(local)}

这篇关于企业库5.0 - 应用程序日志记录 - 日期时间不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆