Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Logging system in Qt.
-
Hello!
Usually I am using my own solution for logging, but now researching about Qt-native logging. Is in Qt logging system included? I mean not qmessagelogger, I mean full featured logging system that allow to store logs and send it if need to server? I found some of them, but all of them 3d-part libs:- http://jpnaude.github.io/Qtilities/page_logging.html
- http://log4qt.sourceforge.net or https://github.com/MEONMedical/Log4Qt
- https://github.com/sfadiga/QLogger
There are some examples of using qmessagelogger for storing logs to file:
What is the best way to store logs and send it in current Qt?
-
You can install your own message handler with qInstallMessageHandler.
With this handler you're able to catch all messages and store them where ever you want.
-
@bogong
As @bogong says the Qt entry point to logging isqInstallMessageHandler
. However, that/Qt in-built is not going to "send it if need to server" (whatever that server might be). You/someone would have to write code for anything like that.
-
@bogong I'm in the same boat, which one did you end up using?