I guess you intend to log client messages to a file/storage instead of simple console output, which you can do with console.log. So one option is to store your log messages locally with the Storage component, similar to storing other user-data of your app. The storage uses a local SQLite database, you can also create your own local database with the QtQuick Local Storage feature.
The new Felgo update 2.17.0 also adds a new interesting feature: The FileUtils allow to work with the local file system, to e.g. write a custom log file directly from QML (otherwise, file access requires Qt C++ code).
the messages are available with the msg property of the function. Please also make sure to set the custom handler after Felgo is initialized. Otherwise it is overwritten again:
void myMessageHandler(QtMsgType type, const QMessageLogContext &, const QString & msg)
qDebug() << "MY MESSAGE HANDLER: " << msg;
int main(int argc, char *argv)
QApplication app(argc, argv);
// Use platform-specific fonts instead of Felgo's default font
// QQmlApplicationEngine is the preferred way to start qml projects since Qt 5.2
// if you have older projects using Qt App wizards from previous QtCreator versions than 3.1, please change them to QQmlApplicationEngine
// use this during development
// for PUBLISHING, use the entry point below
// use this instead of the above call to avoid deployment of the qml files and compile them into the binary with qt's resource system qrc
// this is the preferred deployment option for publishing games to the app stores, because then your qml files and js files are protected
// to avoid deployment of your qml files and images, also comment the DEPLOYMENTFOLDERS command in the .pro file
// also see the .pro file for more details
// set custom message handler
// note: requires to be called after vplay.initialize(&engine)
// the Felgo initialization overwrites the handler otherwise
Want to find out if Felgo is a good fit for your company?
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: