Page 1 of 2
Monitoring User Logins
Posted: Wed Feb 12, 2020 10:39 am
by chewza
Hi there
We are running Pa2, and I am trying to get a record of user logins.
Transaction logging is set for the }ClientProperties cube, but when I review the transaction log, nothing is there.
Any idea?
Regards
Chris
Re: Monitoring User Logins
Posted: Wed Feb 12, 2020 10:59 am
by Drg
Check }CubeProperties LOGGINING mustbe "YES"
Re: Monitoring User Logins
Posted: Wed Feb 12, 2020 12:13 pm
by Wim Gielis
Did you do a Savedata, in order to get a timestamped text file (in the logging directory) containing the data changes since the last savedata or server restart ?
Re: Monitoring User Logins
Posted: Wed Feb 12, 2020 1:44 pm
by tomok
Putting something like this in your tm1slog.properties file will create a separate log file with login activity:
Code: Select all
log4j.logger.TM1.Login=DEBUG, LOCK
log4j.additivity.TM1.Login=false
log4j.appender.LOCK=org.apache.log4j.SharedMemoryAppender
log4j.appender.LOCK.File=lock.log
log4j.appender.LOCK.MaxFileSize=100 MB
log4j.appender.LOCK.MaxBackupIndex=20
log4j.appender.LOCK.TimeZone=GMT
This particular example writes all login activity to a file called lock.log.
Re: Monitoring User Logins
Posted: Wed Feb 12, 2020 1:50 pm
by chewza
Hi there
Logging is set, and we do a SaveData every 5 minutes
Regards
Chris
Re: Monitoring User Logins
Posted: Wed Feb 12, 2020 2:10 pm
by tomok
I'm not sure what you are trying to capture with the }ClientProperties cube. There is no attribute in that cube that is going to show login activity. You are going to have to do that in a log like the example I gave you. You don't have to create a separate file, you can make it write to the server log, but you have to have the
log4j.logger.TM1.Login=DEBUG, LOCK
log4j.additivity.TM1.Login=false
lines in your tm1slogging.properties file.
Re: Monitoring User Logins
Posted: Wed Feb 12, 2020 2:29 pm
by chewza
Hi Tom
Much appreciated, will give it a bash.
Regarding the }ClientProperties cube, I have seen a few posts where people claim that checking out a transaction log on this cube will give you login information.
Regards
Chris
Re: Monitoring User Logins
Posted: Wed Feb 12, 2020 3:25 pm
by tomok
Maybe it used to work in TM1 but it does not in PA. I am on PA and I double-checked again to make sure. There is nothing written to the transaction log for the }ClientProperties cube when a user logs in. The solution involving the tm1s-log.properties setting is the only sure-fire way to get what you want that I know of.
Re: Monitoring User Logins
Posted: Wed Feb 12, 2020 5:32 pm
by lotsaram
Drg wrote: ↑Wed Feb 12, 2020 10:59 am
Check }CubeProperties LOGGINING mustbe "YES"
Almost,
and in addition ClientPropertiesSyncInterval must be in tm1s.cfg
tomok wrote: ↑Wed Feb 12, 2020 3:25 pm
Maybe it used to work in TM1 but it does not in PA. I am on PA and I double-checked again to make sure. There is nothing written to the transaction log for the }ClientProperties cube when a user logs in.
It works and works fine. But for anything to be written against <}ClientProperties, userID, STATUS> ClientPropertiesSyncInterval must be set. It has been like this for a loooong time, like since 9.5 or 10.1
But the solution already suggested to write to a separate log file by adding parameters to tm1s-log.properties file is a much better solution.
Re: Monitoring User Logins
Posted: Wed Feb 12, 2020 8:57 pm
by Wim Gielis
chewza wrote: ↑Wed Feb 12, 2020 1:50 pmHi there
Logging is set, and we do a SaveData every 5 minutes
Regards
Chris
Hmmm, every 5 minutes. Isn't that window rather short ?
Re: Monitoring User Logins
Posted: Thu Feb 13, 2020 7:51 am
by kumesh
Hi,
I cannot find the location for the tm1slog.properties file? Is it not in the same location as the tm1s config file?
Thanks,
Re: Monitoring User Logins
Posted: Thu Feb 13, 2020 8:15 am
by Wim Gielis
Yes. If it’s not there, you should create it. There are examples in the documentation, for example.
Re: Monitoring User Logins
Posted: Thu Feb 13, 2020 11:04 am
by tomok
kumesh wrote: ↑Thu Feb 13, 2020 7:51 am
Hi,
I cannot find the location for the tm1slog.properties file? Is it not in the same location as the tm1s config file?
Thanks,
It is actually called tm1s-log.properties.
Re: Monitoring User Logins
Posted: Thu Feb 13, 2020 12:03 pm
by kumesh
tomok wrote: ↑Thu Feb 13, 2020 11:04 am
kumesh wrote: ↑Thu Feb 13, 2020 7:51 am
Hi,
I cannot find the location for the tm1slog.properties file? Is it not in the same location as the tm1s config file?
Thanks,
It is actually called tm1s-log.properties.
Yes - I cannot find this file either. Will I need to manually create a file and name it ''tm1s-log.properties''.
Thanks,
Re: Monitoring User Logins
Posted: Thu Feb 13, 2020 12:12 pm
by luizg2019
kumesh wrote: ↑Thu Feb 13, 2020 12:03 pm
Yes - I cannot find this file either. Will I need to manually create a file and name it ''tm1s-log.properties''.
Yes, that's what I had to do. Can confirm it worked fine.
Re: Monitoring User Logins
Posted: Thu Feb 13, 2020 12:31 pm
by kumesh
Thanks everyone, will give it a try now.
Re: Monitoring User Logins
Posted: Thu Feb 13, 2020 12:35 pm
by Wim Gielis
kumesh wrote: ↑Thu Feb 13, 2020 12:03 pmWill I need to manually create a file and name it ''tm1s-log.properties''.
Didn't you see my post above ?
Re: Monitoring User Logins
Posted: Thu Feb 13, 2020 12:39 pm
by tomok
While we're on the subject of logging, if you put this in your tm1s-log.properties file it will create a separate log called TI.log that will contain all messages you send from a TI:
Code: Select all
log4j.logger.TM1.TILogOutput=DEBUG, Debug_LogOutput
log4j.appender.Debug_LogOutput=org.apache.log4j.SharedMemoryAppender
log4j.additivity.TM1.TILogOutput=false
log4j.appender.Debug_LogOutput.File=TI.log
log4j.appender.Debug_LogOutput.MaxFileSize=100 MB
I use it to record all instances of a TI process running, who ran it, and what parameters they used. Here is an example:
Code: Select all
# ========================== WRITE PARAMS TO LOG ==================================
LOGOUTPUT('INFO', '---------------------------------------------------------------------------------');
LOGOUTPUT('INFO', GETPROCESSNAME());
LOGOUTPUT('INFO', 'Executed by ' | TM1USER());
LOGOUTPUT('INFO', 'pPeriod - ' | pPeriod);
LOGOUTPUT('INFO', 'pSourceVersion - ' | pSourceVersion);
LOGOUTPUT('INFO', 'pTargetVersion - ' | pTargetVersion);
In this example I will get an entry in the TI.log file that looks like this when the process is run:
Code: Select all
17380 [2032] INFO 2020-02-04 20:23:00.658 TM1.TILogOutput Copy Version
17380 [2032] INFO 2020-02-04 20:23:00.658 TM1.TILogOutput Executed by Planning Analytics/Test User
17380 [2032] INFO 2020-02-04 20:23:00.658 TM1.TILogOutput pPeriod - Jan-2020
17380 [2032] INFO 2020-02-04 20:23:00.658 TM1.TILogOutput pSourceVersion - Actual
17380 [2032] INFO 2020-02-04 20:23:00.658 TM1.TILogOutput pTargetVersion - Forecast
Having this information in a log is extremely helpful when trying to debug a process or finding out who did something.
Re: Monitoring User Logins
Posted: Mon Mar 02, 2020 2:56 pm
by chewza
Hi Tom
Thanks once again for all your help. I have created a tm1s-log.properties file, but now the tm1server.log file has disappeared.
I still want this file to get all info about model startup, when users run TIs etc.
Any idea why?
Below is the contents of my log file.
Many thx!
Regards
Chris
Re: Monitoring User Logins
Posted: Mon Mar 02, 2020 10:14 pm
by qml
chewza wrote: ↑Mon Mar 02, 2020 2:56 pm
Below is the contents of my log file.
Still waiting for it.
