#1 2025-12-14 09:37:46

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

aLog in agl

hi,
in mormot.app.agl in constructor TSynAngelize.Create the aLog parameter is not used somewhere. Or I miss something?

Offline

#2 2025-12-15 02:46:45

zen010101
Member
Registered: 2024-06-15
Posts: 167

Re: aLog in agl

The parent TSynDaemon.Create signature has no aLog parameter:

  constructor TSynDaemon.Create(aSettingsClass: TSynDaemonSettingsClass;
    const aWorkFolder, aSettingsFolder, aLogFolder,
          aSettingsExt, aSettingsName: TFileName;
          aSettingsOptions: TSynJsonFileSettingsOptions;
    const aSectionName: RawUtf8);

  Logging is actually configured via AfterCreate → fSettings.SetLog(TSynLog).

  This appears to be dead code - the parameter exists but does nothing.

Offline

#3 2025-12-15 09:36:46

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,367
Website

Re: aLog in agl

Yes, you are both correct!

Please try with
https://github.com/synopse/mORMot2/commit/15dc02feb

Offline

#4 2026-01-06 19:01:48

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

Re: aLog in agl

Something I can not understand happens after the above changes.
all logs after Starting procedure are not shown when fork is used in linux. But it works ok with -c switch.
Also, if an exception happens, everything is ok and logs are shown in the file.
Also the service takes the timeout to stop.

Offline

#5 Yesterday 20:52:41

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

Re: aLog in agl

During forking, file handlers are lost. So, if logging have been started with aftercreate, any logging will not be saved.
how can we recreate the file handlers for logging during start procedure and forking?

Offline

#6 Today 07:54:38

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,367
Website

Re: aLog in agl

Which logs are you talking about?
The sub-service logs?
The main angelize logs?

Offline

#7 Today 13:47:42

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

Re: aLog in agl

I have a derived class from TSynAngelize
I use Tsynlog as argument in the inherited create function
I set Nofile=false, AutoFlushTimeOut=1, Level=[...], PerThreadLog=ptIdentifiedInOneFile after inherited create function.
I use Tsynlog.dolog(...... to write to the log after that.
The logs are shown in the file but everything is not shown in the log after the process forks, except if an exception happens.

Offline

Board footer

Powered by FluxBB