logging to console

This commit is contained in:
Rafał Jaworski 2019-05-16 14:49:26 +02:00
parent a0a0720c74
commit bf15a5bd11
2 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,7 @@
#include "log4cpp/Appender.hh" #include "log4cpp/Appender.hh"
#include "log4cpp/FileAppender.hh" #include "log4cpp/FileAppender.hh"
#include "log4cpp/OstreamAppender.hh"
#include "log4cpp/PatternLayout.hh" #include "log4cpp/PatternLayout.hh"
#include "log4cpp/Priority.hh" #include "log4cpp/Priority.hh"
@ -65,7 +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::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);

View File

@ -0,0 +1,4 @@
#!/bin/sh
spawn-fcgi -p 8000 -n "@COMPILED_BINARIES_PATH@"/concordia_server_process