Skip to content
Permalink
Browse files

Fix server debug log

  • Loading branch information
mhugent committed May 5, 2014
1 parent 57b450a commit 9d05631777e895d2a9bfa951b59719222538bfb4
Showing with 9 additions and 3 deletions.
  1. +2 −1 src/core/qgslogger.h
  2. +7 −2 src/mapserver/qgis_map_serv.cpp
@@ -118,11 +118,12 @@ class CORE_EXPORT QgsLogger
/** Logs the message passed in to the logfile defined in QGIS_LOG_FILE if any. **/
static void logMessageToFile( QString theMessage );

private:
/**Reads the environment variable QGIS_LOG_FILE. Returns NULL if the variable is not set,
* otherwise returns a file name for writing log messages to.*/
static const QString logFile();

private:

/**Reads the environment variable QGIS_DEBUG_FILE. Returns NULL if the variable is not set.
* If set, only messages from this source file will be sent to logs. */
static const char* debugFile();
@@ -283,14 +283,19 @@ int main( int argc, char * argv[] )
QgsMapRenderer* theMapRenderer = new QgsMapRenderer();
theMapRenderer->setLabelingEngine( new QgsPalLabeling() );

printRequestInfos();

#ifdef QGSMSDEBUG
QgsFontUtils::loadStandardTestFonts( QStringList() << "Roman" << "Bold" );
#endif

QString logFile = QgsLogger::logFile();

while ( fcgi_accept() >= 0 )
{
if ( !logFile.isEmpty() )
{
setenv( "QGIS_LOG_FILE", logFile.toLocal8Bit().data(), 1 );
}

printRequestInfos(); //print request infos if in debug mode

//Request handler

0 comments on commit 9d05631

Please sign in to comment.
You can’t perform that action at this time.