#1 2025-04-22 20:44:02

je_code
Member
Registered: 2025-04-17
Posts: 7

What is the equivalent to mORMot 'ServiceLog' in mORMot2?

I am in the process of converting a Delphi application using 'mORMot v. 1.18' into one using 'mORMot 2.' In the 'mORMot v. 1.18' application, I have the following lines of code:

  // Let's set the logging abilities of the server
  ServiceLog := TSQLLog;
  ServiceLog.Family.Level := LOG_VERBOSE;

  TServiceController.CheckParameters(ExeVersion.ProgramFilePath + c_HTTPExecutableName, c_HTTPServiceName, c_HTTPServiceDisplayName, c_HTTPServiceDescription);

  TSQLLog.Add.Log(sllTrace, 'Quitting command line');

I am having issues converting the above code to use 'mORMot 2.' Indeed, I am not finding an equivalent for 'ServiceLog.' Is there one?

Offline

#2 2025-04-23 07:09:35

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

Re: What is the equivalent to mORMot 'ServiceLog' in mORMot2?

There is not ServiceLog global variable in mORMot 2, to avoid any dependency to TSynLog and mormot.core.log.pas into mormot.core.os.pas.

The logging is done via the TService.DoLog() class method.
So that you can use

WindowsServiceLog := TSynLog.DoLog;

instead.

Offline

Board footer

Powered by FluxBB