• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

log4j date & time running in embedded oc4j

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The date & time on my logs produced via log4j are as at UTC, rather than local time. Since I'm running from a location UTC+12 this is really confusing output.
e.g. each log line starts:
2011-05-12 22:01:04,657 DEBUG ...
when it should be:
2011-05-13 10:01:04,657 DEBUG ...

It only seems to effect logs produced running the embedded OC4J - or at least the start up log for the standalone OC4j is in the correct timezone.
I've tried comparing various config & log files from the standalone directories with the embedded directories butt hat hasn't turned up anything likely.
It is picking up the date & time from the pc - I've tried changing the pc date & that gets 'reflected' in the log date - but isn't correct.
Seems to effect the logs for all apps I'm running in jDeveloper on my pc.
Note that the same apps run on other peoples pcs work fine. I'm the only one on Windows 7 so far though.

Any ideas? Trivial but driving me nuts.
Think it might just be doing it to remind me I'm a Brit working in New Zealand...
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Louise,

According to API doc you can do this.


d : Used to output the date of the logging event. The date conversion specifier may be followed by a set of braces containing a date and time pattern strings SimpleDateFormat, ABSOLUTE, DATE or ISO8601 and a set of braces containing a time zone id per TimeZone.getTimeZone(String). For example, %d{HH:mm:ss,SSS}, %d{dd MMM yyyy HH:mm:ss,SSS}, %d{DATE} or %d{HH:mm:ss}{GMT+0}. If no date format specifier is given then ISO8601 format is assumed.



You may find the reference here.
reply
    Bookmark Topic Watch Topic
  • New Topic