在log4j日志记录中包括微秒时间戳? [英] Include microsecond timestamps in log4j logging?

查看:578
本文介绍了在log4j日志记录中包括微秒时间戳?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

log4j日志记录中是否可能具有微秒级的时间戳?这是在运行Java 1.6的Linux上.

Is it possible to have microsecond level timestamps in log4j logging? This is on linux running Java 1.6.

我们有几台服务器彼此相邻(通过LAN同步到同一台NTP服务器),我希望日志行数微秒.

We have a couple servers right next to each other (synced via LAN to the same NTP server), and I'd like to have microseconds in the log lines.

如果log4j不提供此功能,是否进行回退?

If log4j doesn't offer this, does logback?

推荐答案

Log4j不包含微秒精度的时间戳. Logback当前不包括微秒精度的时间戳,但将来的logback版本可能会包含.

Log4j does not include microsecond precision timestamps. Logback does not currently include microsecond precision timestamps but future versions of logback probably will.

这篇关于在log4j日志记录中包括微秒时间戳?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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