本文介绍了如何更改 log4c 的默认时区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚通过 yum 在 CentOS 6.x 上安装了 log4c 和 log4c-devel.除了日志时间,一切正常,慢了 8 小时

I just installed log4c and log4c-devel on CentOS 6.x by yum. All works fine except the log time, it's slow for 8 hours

以下是我机器的输出:

[rafael@localhost ~]$ date
Tue Jan 14 15:17:34 CST 2014

以下是log4c产生的日志:

Following is the log produced by log4c:

20140114 07:17:34.453 DEBUG    GFXLog- CTimerManager::killTimer: time id-0x0000000198c4e0.

你看,慢了 8 小时.我已经用正确的时间和时区设置了我的机器,并保持 ntpd 运行.我想也许我应该设置 log4c 时区,但我不知道如何设置?log4crc 或代码?谷歌找不到任何关于此的文件.

you see, slow for 8 hours. I have setup my machine with correct time and timezone, and also keep ntpd running. I think maybe i should setup log4c timezone, but I don't know how? log4crc or code? cannot find any document about that by google.

推荐答案

我遇到了完全相同的问题,但在 Ubuntu 14.04 中 dated_local 不可用,因为 log4c 是旧版本.我根据最新的 log4c 代码编写了一个更新,不需要修改提供的共享库.

I had exactly the same problem, but in Ubuntu 14.04 dated_local is not available because log4c is an older version. I wrote an update based on the latest log4c code which does not require modifying the supplied shared library.

参见 https://bugs.launchpad.net/ubuntu/+源/log4c/+bug/1314576

这篇关于如何更改 log4c 的默认时区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-08 13:07