Log4Qt - Logging for the Qt cross-platform application framework
Log4Qt - Logging for the Qt cross-platform application framework
Log4Qt is a C++ port of the Apache Software Foundation Log4j package using the Qt Framework. It is intended to be used by open source and commercial Qt projects.
http://log4qt.sourceforge.net/
This Log4Qt repository is a clone of the Log4Qt repository from https://gitorious.org/log4qt which was itself a clone of the original Log4Qt project on SourceForge http://sourceforge.net/projects/log4qt/ (http://log4qt.sourceforge.net/).
log4qt.json) alongside the classic .properties formatlog4qt.xml) alongside .properties and .json formatsAs an alternative to log4qt.properties, you can use a log4qt.json file:
{
"log4j": {
"rootLogger": "DEBUG, console",
"appender": {
"console": {
"type": "org.apache.log4j.ConsoleAppender",
"target": "STDOUT_TARGET",
"layout": {
"type": "org.apache.log4j.TTCCLayout",
"dateFormat": "ISO8601"
}
}
},
"logger": {
"MyApp": "ERROR, console"
},
"additivity": {
"MyApp": "false"
}
}
}Nested objects produce dot-separated property keys, and the type key sets the class
(appender, layout, filter, …) for the parent object — not class or @class. The
value accepts the legacy org.apache.log4j.* names, the Log4Qt::* names, or the short
aliases (e.g. Console, TTCCLayout). Place the file next to your executable or in the
working directory. When both log4qt.properties and log4qt.json exist, the .properties
file takes priority.
You can also configure programmatically:
#include
Log4Qt::JsonConfigurator::configure("path/to/config.json");
// or with file watching:
Log4Qt::JsonConfigurator::configureAndWatch("path/to/config.json");As an alternative to .properties and .json, you can use a log4qt.xml file:
DEBUG, console
org.apache.log4j.ConsoleAppender
STDOUT_TARGET
org.apache.log4j.TTCCLayout
ISO8601
ERROR, console
false
Nested elements produce dot-separated property keys, and a `` element sets the class
for the parent element — not a class attribute as in Log4j's XML. (Attributes flatten
to child properties, so type="..." as an attribute also works, but class="..." does
not.) Priority order: .properties > .json > .xml.
You can also configure programmatically:
#include
Log4Qt::XmlConfigurator::configure("path/to/config.xml");
// or with file watching:
Log4Qt::XmlConfigurator::configureAndWatch("path/to/config.xml");stdext array iterators that MSVC removed).Apache License 2, Version 2.0
git clone https://github.com/MEONMedical/Log4Qt.gitcmake is used to build Log4Qt. An out-of-source build is required:
mkdir Log4Qt-build
cd Log4Qt-build
cmake ../Log4Qt
make/mingw32-make/msbuild Log4Qt.sln
make/mingw32-make install
Addition cmake options are
* '-DBUILD_SHARED_LIBS=OFF' to build static log4qt lib (default: ON)
* '-DBUILD_WITH_DB_LOGGING=ON|OFF to build with database logging support (default: OFF)
* '-DBUILD_WITH_TELNET_LOGGING=ON|OFF to build with telnet appender support (default: ON)
* '-DBUILD_WITH_QML_LOGGING=ON|OFF to build with qml logger support (default: ON)No open issues yet, or sync has not completed.