Page 1 of 1
Use local time instead of GMT as log timstamp
Posted: Thu Apr 02, 2009 3:21 pm
by harrytm1
Hi,
I read in 9.4MR1 Operation Guide that I can set TM1 to log using local time instead of the default GMT. It mentions that the parameter can be written into a logging properties file named tm1s-log.properties.
The problem is, I can't locate this file. It is not in the Log folder, nor is it located in the Sample DB that comes with the installation.
Is there a default file somewhere that I can use? Where can I drop this file so that server will pick it up during startup?
Many thanks in advance!
Re: Use local time instead of GMT as log timstamp
Posted: Thu Apr 02, 2009 5:19 pm
by Andy Key
The tm1s-log.properties file goes in the same directory as your tm1s.cfg.
The file that appeared in my data directory looks like this:
#
# 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=GMT
Changing your last line to
log4j.appender.S1.TimeZone=Local
should give you what you want.
Note that if you are not running your server as a local server, you don't need to stop and start the server, it will notice that you have made changes and act on those changes automatically.
Re: Use local time instead of GMT as log timstamp
Posted: Fri Apr 03, 2009 3:11 am
by harrytm1
thanks, andy. will give it a go.
Re: Use local time instead of GMT as log timstamp
Posted: Fri Apr 03, 2009 3:37 am
by harrytm1
Hi andy,
I created the tm1s.properties file in the same folder where cfg file is residing. the content of this file is as follows:
# 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.rootLogger=INFO, S1
log4j.logger.TM1=INFO
# 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=100
# Specify GMT or Local timezone
log4j.appender.S1.TimeZone=Local
I am testing it in my local server. I restarted the server after i have inserted this file. However, I noticed that the transactions are still being logged at GMT. Also, when I save data, the historical trans log is still append with GMT in the filename. Do i have to set something in the tm1s.cfg file to tell server to read this properties file? This is not mentioned in the Operation Guide. So how do I enable this?
Many thanks in advance!
Re: Use local time instead of GMT as log timstamp
Posted: Fri Apr 03, 2009 9:44 am
by Andy Key
Changing GMT to Local worked for me with a server running as an application. But this setting is only for the Message log. The Transactions are still recorded in GMT. Note that the popup box you get when entering a start time for a query on the Transactions specifies that the time you enter is GMT and there is no way to change that.
Did you call your file tm1s.properties or tm1s-log.properties?
Re: Use local time instead of GMT as log timstamp
Posted: Fri Apr 03, 2009 1:01 pm
by harrytm1
hi andy,
i named it tm1s-log.properties; i made a typo in my earlier post.
i'm running tm1 as a service. So this local time setting is only for message log? my users want all logs (audit log and transaction log, historical log filename etc) to be on local time. This is easier for them to troubleshoot instead of having to adjust for the time diff.
To make matter worse, the pop-up is in GMT! sigh... guess i have to tell them the bad news...
Re: Use local time instead of GMT as log timstamp
Posted: Fri Apr 03, 2009 1:32 pm
by Andy Key
Yep, it only affects the message log.
If your file was named correctly, are you still having problems even getting the message log to change?