Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

LogFile - name and path

Post Reply
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

LogFile - name and path

Post 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.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: LogFile - name and path

Post 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.
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: LogFile - name and path

Post 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
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: LogFile - name and path

Post 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.
Post Reply