logging.cfg and backend_logging.cfg
This commit is contained in:
parent
c00d5149d5
commit
18d3aa4b00
4 changed files with 30 additions and 2 deletions
|
@ -19,6 +19,8 @@
|
|||
#include "log4cxx/consoleappender.h"
|
||||
#include "log4cxx/patternlayout.h"
|
||||
#include "log4cxx/propertyconfigurator.h"
|
||||
#include "log4cxx/helpers/properties.h"
|
||||
#include "log4cxx/helpers/fileinputstream.h"
|
||||
|
||||
using namespace log4cxx;
|
||||
|
||||
|
@ -1037,7 +1039,12 @@ int main(int argc, char **argv) {
|
|||
root->addAppender(new ConsoleAppender(new PatternLayout("%d %-5p %c: %m%n")));
|
||||
}
|
||||
else {
|
||||
log4cxx::PropertyConfigurator::configure(CONFIG_STRING(&config, "logging.backend_config"));
|
||||
log4cxx::helpers::Properties p;
|
||||
log4cxx::helpers::FileInputStream *istream = new log4cxx::helpers::FileInputStream(CONFIG_STRING(&config, "logging.backend_config"));
|
||||
|
||||
p.load(istream);
|
||||
p.setProperty("pid", boost::lexical_cast<std::string>(getpid()));
|
||||
log4cxx::PropertyConfigurator::configure(p);
|
||||
}
|
||||
|
||||
initPurple(config);
|
||||
|
|
11
spectrum/src/backend-logging.cfg
Normal file
11
spectrum/src/backend-logging.cfg
Normal file
|
@ -0,0 +1,11 @@
|
|||
log4j.rootLogger=debug, R
|
||||
|
||||
log4j.appender.R=org.apache.log4j.RollingFileAppender
|
||||
log4j.appender.R.File=backend-${pid}.log
|
||||
|
||||
log4j.appender.R.MaxFileSize=10000KB
|
||||
# Keep one backup file
|
||||
log4j.appender.R.MaxBackupIndex=1
|
||||
|
||||
log4j.appender.R.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.R.layout.ConversionPattern=%d %-5p %c: %m%n
|
11
spectrum/src/logging.cfg
Normal file
11
spectrum/src/logging.cfg
Normal file
|
@ -0,0 +1,11 @@
|
|||
log4j.rootLogger=debug, R
|
||||
|
||||
log4j.appender.R=org.apache.log4j.RollingFileAppender
|
||||
log4j.appender.R.File=spectrum2.log
|
||||
|
||||
log4j.appender.R.MaxFileSize=10000KB
|
||||
# Keep one backup file
|
||||
log4j.appender.R.MaxBackupIndex=1
|
||||
|
||||
log4j.appender.R.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.R.layout.ConversionPattern=%d %-5p %c: %m%n
|
|
@ -18,7 +18,6 @@ protocol=prpl-jabber
|
|||
[logging]
|
||||
#config=logging.cfg # log4cxx/log4j logging configuration file
|
||||
#backend_config=backend_logging.cfg # log4cxx/log4j logging configuration file for backends
|
||||
#config=test.cfg
|
||||
|
||||
[database]
|
||||
type = sqlite3 # or "none" without database backend
|
||||
|
|
Loading…
Add table
Reference in a new issue