3

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?

David
  • 170
  • 2
  • 9
  • Not sure if it qualifies as an answer, but a workaround I've found is to use DebugView from Microsoft Technet. – David Oct 08 '15 at 06:53

2 Answers2

5

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
Thomas
  • 174,939
  • 50
  • 355
  • 478
1

Qgis 3.10.5 seems to work when setting these variables via the options menu.

  1. create an empty text file somewhere
  2. in Qgis Settings > System > Environment add an entry for QGIS_DEBUG and QGIS_LOG_FILE as shown
  3. restart Qgis

enter image description here

ncica
  • 7,015
  • 1
  • 15
  • 37
cefect
  • 88
  • 6
  • Welcome to SO. You can add your image inline, please follow instructions here: https://meta.stackoverflow.com/a/344853/3519504 – Sandeep Kumar May 08 '20 at 04:31