Java:如何将java.util.logging的语言更改为英语? [英] Java: How to change the language of java.util.logging to English?

查看:148
本文介绍了Java:如何将java.util.logging的语言更改为英语?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有java.util.logging将输出打印到文件。它工作正常。但是,消息包含对应于日志级别的中文字符以及记录消息的时间。

I have java.util.logging to print output to a file. It works fine. However, the messages contain chinese characters which correspond to the log level and the time the messages are logged.

如何打印英文而不是中文字符?

How can I make it print english instead of chinese characters ?

这是当前消息的样子

11月 08, 2016 8:28:03 下午 mySamples.testing.TestingFile errorFunction
資訊: Exception: 123


推荐答案

通过传递命令语言来启动你的应用程序 - line以覆盖操作系统的当前默认语言。

Start your application by passing the language on the command-line to override the current default language of the OS.

java -Duser.language=en MyApplication

这篇关于Java:如何将java.util.logging的语言更改为英语?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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