Page 1 of 1

LogFile - name and path

Posted: Mon May 09, 2022 10:34 am
by dilfich

Code: Select all

GlobalCEFApp.LogFile              := 'deb777ug.log';
Two files are created deb777ug.log and debug.log. The entries go to the debug.log file, and deb777ug.log is empty. What's wrong?
I run several instances using one EXE file, I wanted to set my own filename for each, but it doesn't work that way, only one debug.log.

Re: LogFile - name and path

Posted: Tue May 10, 2022 9:10 am
by salvadordf
I modified the MiniBrowser demo with this code in uMiniBrowser.pas :

Code: Select all

procedure CreateGlobalCEFApp;
begin
  GlobalCEFApp                     := TCefApplication.Create;
  GlobalCEFApp.cache               := 'cache';
  GlobalCEFApp.EnablePrintPreview  := True;
  GlobalCEFApp.EnableGPU           := True;
  GlobalCEFApp.LogFile             := 'deb777ug.log';
  GlobalCEFApp.LogSeverity         := LOGSEVERITY_VERBOSE;
end;
I also added this in the Chromium1AfterCreated procedure :

Code: Select all

CefDebugLog('test');
Before executing that demo I deleted any old "debug.log" file from the bin directory.

I run the demo and I saw the new deb777ug.log file. All the log contents were written to deb777ug.log.

Check that each app instance is using a different cache directory and a different log file name.
Chromium can't share the same cache directory between several app instances.

Re: LogFile - name and path

Posted: Tue May 10, 2022 9:53 am
by dilfich
I'll try, in my case there are no directories, incognito mode is used.
The problem seems to be with this

Code: Select all

GlobalCEFApp.LogProcessInfo       := True;
Then two files are created, with the specified name and the default debug.log

Re: LogFile - name and path

Posted: Tue May 10, 2022 12:52 pm
by salvadordf
That property is only used to add the process ID to the log even before CEF is initialized and this is why it uses the default file name.
Remove that line.