Renderer logs not showing in log file

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Renderer logs not showing in log file

Postby sjames1958 » Thu May 20, 2021 5:56 am

Environment - macos
CEF version - 87.1.14+ga29e9a3

When starting up CEF we are specifying the log file in settings.

settings.log_severity = LOGSEVERITY_INFO;
CefString(&settings.log_file) = CefString(ESDirectoryUtils::getSTRootDirectory() + DIR_SLASH + CEF_DEBUG_LOG);

We have logging in the renderer process like

LOG(INFO) << "Register JS Function: " << functionName;

[0520/054903.570930:INFO:ESRendererHandler.cpp(23)] Register JS Function: registerFunc

Why wouldn't these logs end up in the log file? I see them in the "target output" window in Xcode.
sjames1958
Techie
 
Posts: 36
Joined: Sun Jun 22, 2014 7:41 am

Re: Renderer logs not showing in log file

Postby ndesktop » Thu May 20, 2021 3:15 pm

Try running with --no-sandbox. I am not familiar with the inner working of sandbox, but I suspect the console output does not appear due to either security or separate desktop.
ndesktop
Master
 
Posts: 556
Joined: Thu Dec 03, 2015 10:10 am

Re: Renderer logs not showing in log file

Postby magreenblatt » Thu May 20, 2021 3:27 pm

Note it should still be written to the debug.log file, just not to console when sandbox is enabled. Does getSTRootDirectory return an absolute file path?
magreenblatt
Site Admin
 
Posts: 10919
Joined: Fri May 29, 2009 6:57 pm

Re: Renderer logs not showing in log file

Postby HarmlessDave » Thu May 20, 2021 3:32 pm

For your own logging you can also write to a separate log file. We have a LogTRACE(const char* fmt, ...) function that takes a printf-string and variable parameter list that writes to log-(process-id).txt so there is no need for IPC and no race conditions between different processes.
HarmlessDave
Expert
 
Posts: 315
Joined: Fri Jul 11, 2014 2:02 pm

Re: Renderer logs not showing in log file

Postby sjames1958 » Fri May 21, 2021 8:05 am

Here is the command line for the renderer process

502 41372 41358 0 6:59AM ?? 0:00.27 /Users/sjames/Library/Developer/Xcode/DerivedData/SoftestV12-ddgjlkyrhporenbezmzniqayanso/Build/Products/Debug/Test.app/Contents/Frameworks/Examplify Helper (Renderer).app/Contents/MacOS/Examplify Helper (Renderer) --type=renderer --js-flags=--max-old-space-size=10000 --log-file=/Library/Application Support/Test/QA//cefDebug.log --remote-debugging-port=8088 --field-trial-handle=1718379636,13452048941118429465,14273150800753843321,131072 --enable-features=CastMediaRouteProvider --disable-gpu-compositing --lang=en-US --log-file=/Library/Application Support/Test/QA//cefDebug.log --log-severity=info --num-raster-threads=4 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --enable-main-frame-before-activation --renderer-client-id=5 --no-v8-untrusted-code-mitigations --shared-files --seatbelt-client=35


I do see the console.log output in the cefDebug.log, but none of the logging from the c++ application code in the renderer
Example:
[0521/065911.579525:INFO:CONSOLE(22929)] " ** resolveHtmlPath: ../HTML/dialogs/dialogs.html", source: http://127.0.0.1/UI/HTML/softest.js (22929)
sjames1958
Techie
 
Posts: 36
Joined: Sun Jun 22, 2014 7:41 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 16 guests