• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do I set the system time?

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I run java programs on an IBM AS400. In my logs (for java web-applications on Tomcat), messages are associated with a system time which is obviously out of sync with the system time on the AS400. Is there a JRE time I should set? How would I do so?
Thanks
Robyne
 
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
AFAIK, the JRE takes its time from the machine that it is running on. If you see different times in you log files, there are a couple things to check:
1). Are you looking at the correct logfiles? (Embarassing, but it happens to everyone...)
2). Is the JRE producing the logfiles on the same machine as the logfiles? If not, check the time on the machine where the JRE is.
3). How does the time get into the logfiles? If it is taken from a Database Server (e.g.,through a "select sysdate from dual;" in Oracle), then the time on the DB Server and your machine may be out of synch.
 
robyne vaughn
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

1). Are you looking at the correct logfiles? (Embarassing, but it happens to everyone...)


I'm sure.


2). Is the JRE producing the logfiles on the same machine as the logfiles? If not, check the time on the machine where the JRE is.


Yes, I'm talking about my web application logs on Tomcat on AS400


3). How does the time get into the logfiles? If it is taken from a Database Server (e.g.,through a "select sysdate from dual;" in Oracle), then the time on the DB Server and your machine may be out of synch.


Associating the time with the log files is accomplished in my server.xml where I specify timestamp="true

just now I forced an error to one of my logs. It logged it as
2003-11-11 18:19:46
According to my workstation and to the system on which tomcat runs, it should have logged something near 12:27:++

I would appreciate any more suggestions you might have.
Thanks,
Robyne
:roll:
 
reply
    Bookmark Topic Watch Topic
  • New Topic