Eclipse RCP应用程序日志视图:更改/设置发送到Eclipse日志视图的消息的TimeZone [英] Eclipse RCP application Log View: change/set TimeZone for messages sent to the Eclipse Log view

查看:274
本文介绍了Eclipse RCP应用程序日志视图:更改/设置发送到Eclipse日志视图的消息的TimeZone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个使用Eclipse日志视图的RCP应用程序。



所有记录的消息都将TimeZone设置为系统当前时间。
我需要在格林尼治标准时间内提供所有这些消息,例如



据我所见,没有关于发布的时间戳的直接定制可能性Eclipse日志视图。



Eclipse类的子类别等也不会有太大帮助,因为我们必须改变的大部分事情是私有字段/私有方法'内部'类。



有关如何配置我的RCP应用程序中的eclipse Log View插件的任何建议,以便在GMT时间内使用这些日志消息的时间? / p>

非常感谢

解决方案

您可以通过系统属性设置时区 user.timezone 和Java类 java.util.TimeZone



示例



您要将时区更改为 GMT

  System.setProperty(user.timezone,GMT); 
TimeZone.setDefault(null);






注1: TimeZone.setDefault(null)需要将默认时区重置为由 user.timezone



注2:这将改变您的JVM的时区。


I'm developing an RCP application that uses the Eclipse Log view.

All the messages logged have the TimeZone set to system current time. I need to have those messages all in GMT time for example

As far as I can see, there is no direct customisation possibility regarding the emitted timestamps in the Eclipse Log view.

Subclassing of Eclipse classes etc. wouldn't help much either, since most of the things we would have to change are private fields / private methods of 'internal' classes.

Any suggestion on how I can configure the eclipse Log View plugin in my RCP application to have the time of those log messages in GMT time for instance?

Many Thanks

解决方案

You can set the timezone via the system property user.timezone and the Java class java.util.TimeZone.

Example

You want to change the timezone to GMT:

System.setProperty("user.timezone", "GMT");
TimeZone.setDefault(null);


Note 1: TimeZone.setDefault(null) is required to reset the default timezone to the new value provided by user.timezone

Note 2: This will change the timezone of your JVM.

这篇关于Eclipse RCP应用程序日志视图:更改/设置发送到Eclipse日志视图的消息的TimeZone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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