QGIS does not write its log messages to a file by default.
If you have a debug build (nightlies normally are) they are written to stdout. That means that if you run it in a terminal on linux you will see the messages there. On Windows I think there is a tool called Debugging Tools for Windows or similar that can intercept the messages.
An alternative is to use some minimal python scripting. Every message is emitted as a Qt signal. Therefore we can connect to these signals and write them to a file. Simply copy the following command to your python console
For QGIS 3:
from qgis.core import QgsApplication
filename = '/tmp/qgis.log'
def write_log_message(message, tag, level):
with open(filename, 'a') as logfile:
logfile.write('{tag}({level}): {message}'.format(tag=tag, level=level, message=message))
QgsApplication.messageLog().messageReceived.connect(write_log_message)
Or for QGIS 2:
filename = '/tmp/qgis.log'
def write_log_message(message, tag, level):
with open(filename, 'a') as logfile:
logfile.write('{tag}({level}): {message}'.format(tag=tag, level=level, message=message))
QgsMessageLog.instance().messageReceived.connect(write_log_message)
When you run this code, the output will be written to /tmp/qgis.log
.