如何在Java日志记录中格式化日期? [英] How to format date in java logging?

查看:88
本文介绍了如何在Java日志记录中格式化日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用:

log.info("Message");

,输出为:

Jul 8, 2014 12:58:02 PM myclass main
INFO: message

我如何只打印不带日期和INFO的消息??

How do i just print the message without the date and INFO: ?

推荐答案

更改

或在 logging.properties :

java.util.logging.SimpleFormatter.format=%2$s: %5$s%6$s%n

所有这些属性都记录在

All of these properties are documented in the format method.

这篇关于如何在Java日志记录中格式化日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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