Class: QgsServerLogger

class qgis.server.QgsServerLogger

Bases: QgsMessageLogConsole

Writes message log into server logfile

Methods

childEvent

connectNotify

customEvent

disconnectNotify

formatLogMessage

Formats a log message.

instance

Gets the singleton instance

isSignalConnected

logLevel

Gets the current log level

logMessage

Log a message from the server context

receivers

sender

senderSignalIndex

setLogFile

Set the current log file

setLogLevel

Set the current log level

setLogStderr

Activates logging to stderr.

timerEvent

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
formatLogMessage(self, message: str, tag: str, level: Qgis.MessageLevel = Qgis.MessageLevel.Info)str

Formats a log message. Used by child classes.

Parameters
  • message – the message to format

  • tag – the tag of the message

  • level – the log level of the message

New in version 3.4.

instance()QgsServerLogger

Gets the singleton instance

Return type

QgsServerLogger

isSignalConnected(self, QMetaMethod)bool
logLevel(self)Qgis.MessageLevel

Gets the current log level

Return type

Qgis.MessageLevel

Returns

the log level

New in version 3.0.

logMessage(self, message: str, tag: str, level: Qgis.MessageLevel)

Log a message from the server context

Parameters
  • message (str) – the message

  • tag (str) – tag of the message

  • level (Qgis.MessageLevel) – log level of the message

receivers(self, PYQT_SIGNAL)int
sender(self)QObject
senderSignalIndex(self)int
setLogFile(self, filename: str = '')

Set the current log file

Parameters

filename (str = '') –

setLogLevel(self, level: Qgis.MessageLevel)

Set the current log level

Parameters

level (Qgis.MessageLevel) – the log level

New in version 3.0.

setLogStderr(self)

Activates logging to stderr.

New in version 3.4.

timerEvent(self, QTimerEvent)