Problem reading TM1 transaction log via TM1Api
Posted: Wed Feb 24, 2016 2:48 pm
Hi All,
I have a little problem reading the transaction Log of my running Tm1 Instance. (tm1s.log)
I want to get the information within an C# application using the TM1 C Api. I am already using this Api successful for many querys, but i cant figure out the TM1ServerLogOpen and TM1ServerLogNext functions. I don't know if i understood them correctly, but these two functions should be able to read the transaction log while the TM1 server instance is running.
I hope somebody already used this function and can help me. Here is the related code:
hPool, hServer and hUser are definitly set correctly, i use them in other TM1Api functions that work correctly.
The Timestamp should resemble the date December 20, 2015. (Looking into the transaction log via architect shows, that i have data since this date)
All three filters are set to *, because i would be happy if I get any sort of data.
I also check the result for errors. Both checks return "Error code out of range", which should be fine, however the entryvalue is always null.
I dont even know, if that is the correct way to use those two functions. (The documentation in the reference guide is pretty wanky in my opinion)
Thanks in advance!
Sincerely,
Alexander Jell
I have a little problem reading the transaction Log of my running Tm1 Instance. (tm1s.log)
I want to get the information within an C# application using the TM1 C Api. I am already using this Api successful for many querys, but i cant figure out the TM1ServerLogOpen and TM1ServerLogNext functions. I don't know if i understood them correctly, but these two functions should be able to read the transaction log while the TM1 server instance is running.
I hope somebody already used this function and can help me. Here is the related code:
Code: Select all
int Timestamp = TM1API.TM1ValString(hPool, "2015122000000", 0);
int Cubefilter = TM1API.TM1ValString(hPool, "*", 0);
int sUserfilter = TM1API.TM1ValString(hPool, "*", 0);
int Flagfilter = TM1API.TM1ValString(hPool, "*", 0);
int opened = TM1API.TM1ServerLogOpen(hPool, hServer, Timestamp, Cubefilter, sUserfilter, Flagfilter);
String error = TM1API.TM1ValErrorString2(hUser, opened);
int entry = TM1API.TM1ServerLogNext(hPool, hServer);
error = TM1API.TM1ValErrorString2(hUser, entry);
int entryone = TM1API.TM1ValArrayGet(hUser, entry, 1);
String entryvalue = TM1API.TM1ValStringGet2(hUser, entryone);
The Timestamp should resemble the date December 20, 2015. (Looking into the transaction log via architect shows, that i have data since this date)
All three filters are set to *, because i would be happy if I get any sort of data.

I also check the result for errors. Both checks return "Error code out of range", which should be fine, however the entryvalue is always null.
I dont even know, if that is the correct way to use those two functions. (The documentation in the reference guide is pretty wanky in my opinion)
Thanks in advance!
Sincerely,
Alexander Jell