You are not logged in.
Pages: 1
On Linux, the LogPath variable cannot be set in the constructor of the TSynDaemon class. The LogPath variable is initialized in the TSynDaemonSettings class and thus the aLogFolder parameter is not considered. This makes the behavior different between Windows and Linux compilation.
constructor TSynDaemonSettings.Create;
begin
...
{$ifndef MSWINDOWS}
fLogPath := GetSystemPath(spLog); // /var/log or $home
{$endif MSWINDOWS}
end;
constructor TSynDaemon.Create(aSettingsClass: TSynDaemonSettingsClass;
const aWorkFolder, aSettingsFolder, aLogFolder, aSettingsExt, aSettingsName: TFileName);
var
fn: TFileName;
begin
...
if fSettings.LogPath = '' then
if aLogFolder = '' then
fSettings.LogPath := {$ifdef MSWINDOWS}fWorkFolderName{$else}GetSystemPath(spLog){$endif}
else
fSettings.LogPath := EnsureDirectoryExists(aLogFolder);
end;
With best regards
Thomas
Offline
Pages: 1