Logging Output handler Text with windows service type server

hello,
I created xdata with the windows service type using the wizard, but I couldn't find a way to logging setup with the TTMSLoggerTextOutputHandler output. I've added TLoggingMiddleware to the server.pas file

// add logging
  LoggingMiddleware := TLoggingMiddleware.Create;
  LoggingMiddleware.FormatString := ':remoteaddr :method :url :statuscode - :responsetime ms';
  Module.AddMiddleware(LoggingMiddleware);

and setup the output hadler text when the service module is created and also try it on the server.pas file

procedure THelloServer.ServiceCreate(Sender: TObject);
begin
  RegisterTMSLogger;
  TMSDefaultLogger.RegisterOutputHandlerClass(
    TTMSLoggerTextOutputHandler, ['xdata.log']);
end;

where should I add RegisterOutputHandler?

thank you

Sorry, I was looking at the windows/system32 system folder. in fact it is stored in the syswow64 folder.
I replaced the location with a special log folder 'c:\log\xdata.log' to make it easier and more organized.

procedure THelloServer.ServiceCreate(Sender: TObject);
begin
  RegisterTMSLogger;
  TMSDefaultLogger.RegisterOutputHandlerClass(
    TTMSLoggerTextOutputHandler, ['c:\log\xdata.log']);
end;

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.