提交 3c19ae94 编写于 作者: A antirez

Add year in log.

User: "is there a reason why redis server logs  are missing the year in
the "date time"?"

Me: "I guess I did not imagine it would be stable enough to run for
several years".
上级 15be174c
...@@ -357,7 +357,7 @@ void serverLogRaw(int level, const char *msg) { ...@@ -357,7 +357,7 @@ void serverLogRaw(int level, const char *msg) {
gettimeofday(&tv,NULL); gettimeofday(&tv,NULL);
struct tm tm; struct tm tm;
nolocks_localtime(&tm,tv.tv_sec,server.timezone,server.daylight_active); nolocks_localtime(&tm,tv.tv_sec,server.timezone,server.daylight_active);
off = strftime(buf,sizeof(buf),"%d %b %H:%M:%S.",&tm); off = strftime(buf,sizeof(buf),"%d %b %Y %H:%M:%S.",&tm);
snprintf(buf+off,sizeof(buf)-off,"%03d",(int)tv.tv_usec/1000); snprintf(buf+off,sizeof(buf)-off,"%03d",(int)tv.tv_usec/1000);
if (server.sentinel_mode) { if (server.sentinel_mode) {
role_char = 'X'; /* Sentinel. */ role_char = 'X'; /* Sentinel. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册