Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

How to get configuration attribute from TMSLogger?

 Post Reply Post Reply
Author
Czech Tomasz View Drop Down
Member
Member
Avatar

Joined: 31 Mar 2017
Posts: 64
Post Options Post Options   Quote Czech Tomasz Quote  Post ReplyReply Direct Link To This Post Topic: How to get configuration attribute from TMSLogger?
    Posted: 12 Sep 2019 at 7:41am
Hi,
I load logger configuration from file, text output handler is configured like below:

[Managed.0.TTMSLoggerTextOutputHandler]
Active=1
ApplyOutputParameters=1
FileName=G:\DelphiProjects\DANSOFT_dotwWebService\Win32\Release\DANSOFT_dotwpwa_WebService.log

In my app I load configuration like this:
TMSLogger.LoadConfigurationFromFile('logger.ini');

How can I get FileName attribute after load configuration?
I can't see any configuration handle in TMSLogger object.

Regards,

Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2389
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 13 Sep 2019 at 3:53pm
Hi Tomasz,

Here is sample code you can use as a start:

procedure TForm4.Button2Click(Sender: TObject);
var
  Handler: TTMSLoggerBaseOutputHandler;
begin
  for Handler in TMSLogger.ManagedOutputHandlers do
    if Handler is TTMSLoggerTextOutputHandler then
      ShowMessage(TTMSLoggerTextOutputHandler(Handler).FileName);
end;
Back to Top
Czech Tomasz View Drop Down
Member
Member
Avatar

Joined: 31 Mar 2017
Posts: 64
Post Options Post Options   Quote Czech Tomasz Quote  Post ReplyReply Direct Link To This Post Posted: Yesterday at 7:14am
Thanks for your help ... now all is clear :)
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down