[Qt-interest] Logging to files

Sean Harmer sean.harmer at maps-technology.com
Wed May 12 16:23:25 CEST 2010


Hi,

On Wednesday 12 May 2010 15:13:38 pmqt71 wrote:
> Hi,
> 
> I need to write to log files in my server application.
> 
> Is there any support in Qt?
> 
> If not, what do you use?

If you are using the QtService solution then you can simply call 
QtServiceBase::instance()->logMessage( msg ) to log to the system logger.

If not then you can do your own thing with QFile and QTextStream or if you 
simply want to record the qDebug(), qWarning() et al messages you can install 
a handler with qInstallMsgHandler that knows how to write to a file.

Cheers,

Sean



More information about the Qt-interest-old mailing list