企业绩效管理网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1312|回复: 5

How to use TM1ServerLogSetFlagString API function ?

[复制链接]

81

主题

410

帖子

598

积分

高级会员

Rank: 4

积分
598
QQ
发表于 2014-6-27 19:33:53 | 显示全部楼层 |阅读模式
Hi all,

I want to change timestamp from GMT(default) to LOCAL when viewing transaction log. IBM told me to use TM1ServerLogSetFlagString API function but didn't show me how to use it. Anyone who has used this function please help !

Thanks in advanced !
Tin Pham.
回复

使用道具 举报

81

主题

429

帖子

608

积分

高级会员

Rank: 4

积分
608
QQ
发表于 2014-6-27 21:46:37 | 显示全部楼层
phamtinkt88 wrote:I want to change timestamp from GMT(default) to LOCAL when viewing transaction log. IBM told me to use TM1ServerLogSetFlagString API function but didn't show me how to use it. Anyone who has used this function please help !

Yet more cr@p documentation (or lack thereof) out of Armonk.

The only reference that I can find to that function is in the Operations guide. Under "Logging Transactions" it states:
The information recorded in the log file includes:
...
?? Date and time the change was made.
?? Name of the client who made the change.
?? Whether the new data is simple data (N) or string data (S).
?? Value before the change.
?? Value after the change.
?? Name of the cube in which the change was made.
?? Elements that identify the cell that changed.
?? Optional user-provided string that is attached to each transaction. You create the string with the TM1ServerLogSetFlagString API function.

The function does not appear in the API guide, nor is it declared in the standard API declarations module. I'd try exporting the current API libraries to see if that offered any clues but don't have the tool that I use to do that to hand at the moment. The only clue that I can see as to the usefulness of this "flag string" is in the TM1ServerLogOpen function of the API manual, where one of the arguments is sFlagFilter; "a long. This TM1 value capsule contains a string used to filter records by flags". Now, to me this suggests that even if you can poke such a flag into the log file it's going to be a static, not a dynamic string like a timestamp, unless you're writing every single transaction via the API and setting the flag to the value of this timestamp as you do each transaction.

In short, I have a sneaking suspicion that you've been given garbage advice.

However you aren't paying an obscene amount for maintenance for nothing so I do suggest that you return to support and say to them "OK, since you've failed to document the function yet again, give me a fully worked example of how I can use it to implement a local timestamp in the log".

My bet is that they won't be able to give you one because I doubt that it can be done (except in the way indicated above) but I my own self would be fascinated to hear what response you get.
回复 支持 反对

使用道具 举报

78

主题

397

帖子

582

积分

高级会员

Rank: 4

积分
582
QQ
发表于 2014-6-27 22:43:07 | 显示全部楼层
phamtinkt88 wrote:Hi all,

I want to change timestamp from GMT(default) to LOCAL when viewing transaction log. IBM told me to use TM1ServerLogSetFlagString API function but didn't show me how to use it. Anyone who has used this function please help !

Thanks in advanced !
Tin Pham.
Interesting, never heard of any ability to change the timestamp of transaction logs before.  You can change the timestamp of the message log in the tm1s-log.properties file quite easily (but this does then invariably lead to some confusion comparing events in the message log in local time vs. the transaction log in GMT.)

As Alan said some interesting advice seem as the API call is not documented!
回复 支持 反对

使用道具 举报

83

主题

396

帖子

573

积分

高级会员

Rank: 4

积分
573
QQ
发表于 2014-6-27 23:11:24 | 显示全部楼层
phamtinkt88 wrote:IBM told me to use TM1ServerLogSetFlagString API function but didn't show me how to use it.
Alan Kirk wrote:In short, I have a sneaking suspicion that you've been given garbage advice.
I have to agree with Alan; unfortunately, on some occasions, the vendor doesn't give the correct advice.

Ive looked at this API function and AFAIK its purpose is to set the last field in an entry to the transaction log:
Code: "","20120220064514","20120220064514","Robin","S","20120214230251","20120220064514","}DimensionProperties","}Processes","LAST_TIME_UPDATED",""
I.e. the field after "LAST_TIME_UPDATED" is the flag string field that can be set via the API. Up until recent versions, this field doesn't get used much, if at all, by TM1. Before 'Undo' came along, the main use I could see for this field was the ability to flag certain transaction logs in order to undo them - maybe in conjunction with API-driven spreading.
phamtinkt88 wrote:I want to change timestamp from GMT(default) to LOCAL when viewing transaction log.
lotsaram wrote:You can change the timestamp of the message log in the tm1s-log.properties
I don't know if that changes the timezone of entries in the transaction log - these logs are critical to replication so my guess is that they wouldn't allow changing the time zone... but you could try - let us know.

I suppose you could somehow use the API function to set the flag string as a local time flag but this is probably more work than using other alternatives.

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 支持 反对

使用道具 举报

79

主题

384

帖子

573

积分

高级会员

Rank: 4

积分
573
QQ
发表于 2014-6-27 23:39:41 | 显示全部楼层
rmackenzie wrote:I suppose you could somehow use the API function to set the flag string as a local time flag but this is probably more work than using other alternatives.

Yes, I believe that this was what the advice was getting at; not to use the function to alter the primary timestamp (which is not possible, as far as I know), but rather to enter a local one into the "flag" field. However as I said I can't see how that kind of kludge could fly unless every entry was made by the API.

Still, it would allow one service rep to clear an SR from their books...
回复 支持 反对

使用道具 举报

70

主题

353

帖子

524

积分

高级会员

Rank: 4

积分
524
QQ
发表于 2014-6-27 23:46:27 | 显示全部楼层
rmackenzie wrote:[quote]phamtinkt88 wrote:IBM told me to use TM1ServerLogSetFlagString API function but didn't show me how to use it.
Alan Kirk wrote:In short, I have a sneaking suspicion that you've been given garbage advice.
I have to agree with Alan; unfortunately, on some occasions, the vendor doesn't give the correct advice.

[/quote]

And I note from this morning's notifications that all is .
The setLogFlagString() method or function is an Internal function for TM1 , capable of setting the optional provided string in the TM1 Server Log - tm1s.log

Note it is an Internal function, hence no documentation exists that lists functionality.

I'm sorry, but what?   

If it's an "internal function" then it doesn't get exposed. If gets exposed, then it is not, by definition, "internal"... and It. Should. Be. Documented. No ifs, no buts, no maybes, no excuses, if you expose a function, you document it. Period. Without exception.

It appears that the function does what we surmised, though again... that would make it completely useless for setting a timestamp except for any transactions which are input directly through API calls.

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|企业绩效管理网 ( 京ICP备14007298号   

GMT+8, 2021-10-20 01:59 , Processed in 0.092016 second(s), 12 queries , Memcache On.

Powered by Discuz! X3.1 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表