#1 2025-01-13 06:45:07

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 436

logging with agl-angelize

Trying to use angelize I noticed that aLog in the constructor is not used anywhere. Do I miss something?

constructor TSynAngelize.Create(aServiceClass: TSynAngelizeServiceClass;
  aLog: TSynLogClass; const aSectionName: RawUtf8;
  const aWorkFolder, aSettingsFolder, aLogFolder, aSettingsExt, aSettingsName: TFileName;
  aSettingsOptions: TSynJsonFileSettingsOptions);

Secondly, when in windows I start the agl with the -c parameter every log entry created with TSynlog.Add exists in the log file. When I started as a windows service with /start parameter, only log entries before starting the services are logged.
Where the logs entries go?

Thanks in advance

Offline

#2 2025-01-13 07:40:51

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,793
Website

Re: logging with agl-angelize

You are right: TSynLog process is defined by TSynAngelizeSettings.LogClass.
This parameter is not used.

In fact, this low-level TSynLog may be confusing.
In fact, Start calls SetLog() and therefore follow TSynAngelizeSettings.Log/LogPath/LogRotateFileCount parameters.
If you don't overwrite any settings in those fields, you won't have any logs once started.

Offline

#3 2025-01-13 11:27:39

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 436

Re: logging with agl-angelize

ab wrote:

In fact, Start calls SetLog() and therefore follow TSynAngelizeSettings.Log/LogPath/LogRotateFileCount parameters.
If you don't overwrite any settings in those fields, you won't have any logs once started.

With the same code from my part I see a difference between running alg with the -c parameter and /start parameter in windows (compiled with Delphi 12)
When running with the -c parameter as console application that waits the "Enter" to finish, everything is OK
When running with the /start parameter as a windows service then log entries come only from the starting process and stops to
20250113 10272931  ! debug mormot.core.os.TServiceController(02ea5658) Start(agl) Args=0 Handle=17568712
No more log entries from the running service can be found in the log, till I stop the service.
Running as a service does not write any log entries to the file. Are they redirected somewhere else?

Offline

Board footer

Powered by FluxBB