请教log4qt的日志分类问题
由于想学习一下log4qt,自己做了个测试程序,但现在分类死活不对,还望搞过的高手指教。报错信息
02:08:46.629 ERROR Factory: - Cannot convert to type 'Level' for property 'threshold' on object of class 'Log4Qt::DailyRollingFileAppender' (Log4Qt::Factory::CONFIGURATOR_UNKNOWN_TYPE_ERROR, 29)
02:08:46.629 ERROR Factory: - Cannot convert to type 'Level' for property 'threshold' on object of class 'Log4Qt::DailyRollingFileAppender' (Log4Qt::Factory::CONFIGURATOR_UNKNOWN_TYPE_ERROR, 29)
02:08:46.629 ERROR Factory: - Unable to set property value on object (Log4Qt::Factory::CONFIGURATOR_PROPERTY_ERROR, 28): Property 'append' does not exist in class 'Log4Qt::DailyRollingFileAppender' (Log4Qt::Factory)
02:08:46.639 INFO root: - 应用程序中文化代码设置完成.
02:08:46.639 ERROR root: - 测试
80 [] ERROR Log4Qt::Factory - Cannot convert to type 'Level' for property 'threshold' on object of class 'Log4Qt::ConsoleAppender' (Log4Qt::Factory::CONFIGURATOR_UNKNOWN_TYPE_ERROR, 29)
80 [] ERROR Log4Qt::Factory - Cannot convert to type 'Level' for property 'threshold' on object of class 'Log4Qt::DailyRollingFileAppender' (Log4Qt::Factory::CONFIGURATOR_UNKNOWN_TYPE_ERROR, 29)
80 [] ERROR Log4Qt::Factory - Cannot convert to type 'Level' for property 'threshold' on object of class 'Log4Qt::DailyRollingFileAppender' (Log4Qt::Factory::CONFIGURATOR_UNKNOWN_TYPE_ERROR, 29)
80 [] ERROR Log4Qt::Factory - Unable to set property value on object (Log4Qt::Factory::CONFIGURATOR_PROPERTY_ERROR, 28): Property 'append' does not exist in class 'Log4Qt::DailyRollingFileAppender' (Log4Qt::Factory)
-------------------------------------------------------------------
头文件和CPP文件
1.#ifndef VIPMSBUF_H
2.#define VIPMSBUF_H
3.
4.#include <QtSql>
5.#include <QTextEdit>
6.#include <log4qt/logger.h>
7.
8.extern QSqlDatabase MyDBConnect;
9.extern Log4Qt::Logger* vipmslog;
10.extern QTextEdit* monitorinfo;
11.
12.#endif // VIPMSBUF_H
1.#include <QtGui/QApplication>
#include <QTextBrowser>
2.#include <QTextCodec>
3.#include <QMessageBox>
4.#include <QtDebug>
5.#include <QtSql>
6.#include <log4qt/propertyconfigurator.h>
7.#include <log4qt/logmanager.h>
8.#include "mainwindow.h"
9.
10.QSqlDatabase MyDBConnect;
11.QTextEdit* monitorinfo;
12.Log4Qt::Logger* vipmslog = Log4Qt::Logger::rootLogger();
13.
14.int main(int argc, char *argv[])
15.{
16. /// int re_value;
17. /// 设置程序中文支持
18. QTextCodec *codec = QTextCodec::codecForName("System");
19.
20. QTextCodec::setCodecForLocale(codec);
21.
22. QTextCodec::setCodecForCStrings(codec);
23.
24. QTextCodec::setCodecForTr(codec);
25.
26.
27.
28. /// 初始化系统主界面
29.
30. QApplication a(argc, argv);
31.
32. MainWindow w;
33.
34. /// 定义日志文件配置信息
35.
36. vipmslog->removeAllAppenders();
37.
38. Log4Qt::PropertyConfigurator::configure(a.applicationDirPath()+ "/vipmslog.conf");
39.
40. Log4Qt::Logger* vipmslog = Log4Qt::Logger::rootLogger();
41.
42. /// Log4Qt::LogManager::setHandleQtMessages(true);
43.
44. vipmslog->info( QObject::tr("应用程序中文化代码设置完成.") );
45.vipmslog->error( QObject::tr("测试") );
46.
47. /// 启动程序主界面
48.w.show();
49.
50. return a.exec();
51.
52.}
--------------------------------------------------------------------------------
配置文件如下
## set log levels ###
log4j.rootLogger = debug , stdout , D , E
### 输出到控制台 ###
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.Threshold = DEBUG
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern = %d{ABSOLUTE} %5p %c{ 1 }:%L - %m%n
### 输出到日志文件 ###
log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
log4j.appender.D.File = logs/run.log
log4j.appender.E.Append = true
log4j.appender.D.Threshold = DEBUG
log4j.appender.D.layout = org.apache.log4j.PatternLayout
log4j.appender.D.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
### 保存异常信息到单独文件 ###
log4j.appender.E = org.apache.log4j.DailyRollingFileAppender
log4j.appender.E.File = logs/error.log
log4j.appender.E.Append = true
log4j.appender.E.Threshold = ERROR
log4j.appender.E.layout = org.apache.log4j.PatternLayout
log4j.appender.E.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
有达人能帮忙看看是什么问题不? --------------------编程问答-------------------- log4j.appender.E.Append = true
log4j.appender.E.Threshold = ERROR
不能使用
--------------------编程问答-------------------- log4j.appender.E.Threshold
补充:移动开发 , Qt