Page 1 of 1

DifferentTimes between server and TM1

Posted: Thu Sep 30, 2010 12:56 pm
by SBrenner
Hello,

after looking for an error I found out, that the timestamp in the log files differs from Windows Server time by two hours.
I'm in the time zone "UTC+1h". Any idea what time zone TM1 has by default and how can I change it?

Kind regards

Steve

Re: DifferentTimes between server and TM1

Posted: Thu Sep 30, 2010 1:05 pm
by lotsaram
By default TM1 logs everything in GMT.

It is a little known fact that this doesn't have to be the case. Just edit the tm1s-log.properties file in notepad and change the time stamp property from "GMT" to "Local" and restart the server and TM1 will then log in local server time. (However only do this if you are not replicating servers across time zones!)

Re: DifferentTimes between server and TM1

Posted: Thu Sep 30, 2010 10:34 pm
by Martin Ryan
Good tip - I'll move this into the tips and tricks forum soon.

However, I haven't been able to get it to work yet - where should this file reside? In the Data directory? Logging directory? I've tried both with no success - example file below.

Does it just alter the tm1s.log file, or the tm1server.log file as well?

Code: Select all

#
#  Enable INFO level logging through the shared memory appender, by default.  The server #  will write informational messages, as well as errors and warnings to the log file.
#

log4j.logger.TM1=INFO, S1

# S1 is set to be a SharedMemoryAppender
log4j.appender.S1=org.apache.log4j.SharedMemoryAppender
# Specify the size of the shared memory segment
log4j.appender.S1.MemorySize=5 MB
# Specify the max filesize
log4j.appender.S1.MaxFileSize=100 MB
# Specify the max backup index
log4j.appender.S1.MaxBackupIndex=20
# Specify GMT or Local timezone
log4j.appender.S1.TimeZone=Local

Re: DifferentTimes between server and TM1

Posted: Fri Oct 01, 2010 6:46 am
by lotsaram
There isn't much to it just change
log4j.appender.S1.TimeZone=GMT
to
log4j.appender.S1.TimeZone=Local

The tm1s-log1.properties file needs to be in the same location as the tm1s.cfg file, so more than likely the data directory. Changing the log mode and file size options have immediate effect but changing the timezone requires a server restart to take effect. I haven't ever had any problems with getting this to work.

Re: DifferentTimes between server and TM1

Posted: Fri Oct 01, 2010 6:51 am
by Alan Kirk
Martin Ryan wrote:Good tip - I'll move this into the tips and tricks forum soon.

However, I haven't been able to get it to work yet - where should this file reside? In the Data directory? Logging directory? I've tried both with no success - example file below.

Does it just alter the tm1s.log file, or the tm1server.log file as well?

Code: Select all

#
#  Enable INFO level logging through the shared memory appender, by default.  The server #  will write informational messages, as well as errors and warnings to the log file.
#

log4j.logger.TM1=INFO, S1

# S1 is set to be a SharedMemoryAppender
log4j.appender.S1=org.apache.log4j.SharedMemoryAppender
# Specify the size of the shared memory segment
log4j.appender.S1.MemorySize=5 MB
# Specify the max filesize
log4j.appender.S1.MaxFileSize=100 MB
# Specify the max backup index
log4j.appender.S1.MaxBackupIndex=20
# Specify GMT or Local timezone
log4j.appender.S1.TimeZone=Local
You're showing your version as 9.1; I believe that this was introduced in 9.4.

Re: DifferentTimes between server and TM1

Posted: Fri Oct 01, 2010 10:54 am
by SBrenner
Thanks for the hint. It works as described.

Re: DifferentTimes between server and TM1

Posted: Sun Oct 03, 2010 9:58 pm
by Martin Ryan
lotsaram wrote: The tm1s-log1.properties file needs to be in the same location as the tm1s.cfg file.
That was my problem. I generally have my cfg file in the parent directory above Data and Logs subdirectories.

Thanks for the tip lotsa.

Martin

Re: DifferentTimes between server and TM1

Posted: Tue Mar 01, 2011 8:07 pm
by nataraja.pl@tcs.com
Thank you so much lotsaram & Alan,It working fine. I am eagerly searching for the same.

Regards,
Nata