Hi,
I've a project running on linux64 with xData with an apachewebbroker. I would like to write logging to a file with tmslogger. This works during the startup of the xDataserver, but returns a permission issue when calling an endpoint from for example postman. The file is created via tmsdefaultlogger.
During start-up:
TMSDefaultLogger.RegisterOutputHandlerClass(TTMSLoggerTextOutputHandler, ['/server/server.log']);
TMSDefaultLogger.RegisterOutputHandlerClass(TTMSLoggerConsoleOutputHandler);
TMSDefaultLogger.Trace('test');
But when calling the healthcheck from the xdata service:
type
[ServiceImplementation]
TMonitoringService = class(TInterfacedObject, IMonitoringService)
private
function Healthcheck: string;
end;
implementation
function TMonitoringService.Healthcheck: string;
begin
TMSDefaultLogger.Trace('test hc');
result := 'Healthy';
end;
initialization
RegisterServiceType(TMonitoringService);
end.
I receive the following error:
{
"error": {
"code": "FOpenError",
"message": "Cannot open file \"'/server/server.log'\". System error: D"
}
}
The healthcheck function works when all permissions are given to the specific folder or file (sudo chmod 777).
How should I let tmsdefaultlogger create the logging file so that its still writable via the xdata services?
Kind regards,
Jan Robroeks