Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get QGIS debug output

Tags:

qgis

I am trying to get my build of QGIS to output the debug messages from calls to QgsDebugMsg. Here's what I have so far:

I've built QGIS configured as RelWithDebugInfo and in the application's Help > About > About window, I see the text: "This copy of QGIS writes debugging output."

In the application's Options > System > Environment Variables window, I've set the environment variables: QGIS_DEBUG = 9 and QGIS_LOG_FILE = C:\Users\USER\Documents\QGIS\log.txt

However, the log file isn't getting created at all. What am I missing?

like image 865
David Avatar asked Jan 18 '26 03:01

David


1 Answers

Answering for QGIS 3.4.1.

These variables are apparently being read too early in the QGIS startup cycle, so it doesn't work if you configure them through Settings > Options > System > Environment Variables.

Instead, you need to set them before QGIS starts. On Linux and macOS, use a command like this:

QGIS_DEBUG=9 QGIS_LOG_FILE=/tmp/qgis.log qgis

On Windows, presumably you'd do something like this in the command prompt:

set QGIS_DEBUG=9
set QGIS_LOG_FILE=C:\Users\USER\Documents\QGIS\log.txt
C:\path\to\qgis\qgis.exe
like image 54
Thomas Avatar answered Jan 19 '26 19:01

Thomas