This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I set the system time?

 
robyne vaughn
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • 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
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • 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: 39
  • Mark post as helpful
  • send pies
  • 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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic