logging to file

This commit is contained in:
rjawor 2019-05-17 09:39:35 +02:00
parent 6725269fa6
commit adce9ab5bf

View File

@ -66,8 +66,8 @@ void Logger::logConcordiaSearchResult(const ConcordiaSearchResult & result) {
} }
void Logger::_initialize(log4cpp::Category & root) { void Logger::_initialize(log4cpp::Category & root) {
// log4cpp::Appender *appender = new log4cpp::FileAppender("default", LOG_FILE_PATH); log4cpp::Appender *appender = new log4cpp::FileAppender("default", LOG_FILE_PATH);
log4cpp::Appender *appender = new log4cpp::OstreamAppender("console", &std::cout); //log4cpp::Appender *appender = new log4cpp::OstreamAppender("console", &std::cout);
log4cpp::PatternLayout *layout = new log4cpp::PatternLayout(); log4cpp::PatternLayout *layout = new log4cpp::PatternLayout();
layout->setConversionPattern("%d{%Y-%m-%d %H:%M:%S.%l}%c %x: %m%n"); layout->setConversionPattern("%d{%Y-%m-%d %H:%M:%S.%l}%c %x: %m%n");
appender->setLayout(layout); appender->setLayout(layout);