Changeset - 803c590d4632
[Not reviewed]
0 4 0
HanzZ - 14 years ago 2011-10-05 09:28:25
hanzz.k@gmail.com
Added variable to log4cxx configs
4 files changed with 13 insertions and 4 deletions:
0 comments (0 inline, 0 general)
backends/libpurple/main.cpp
Show inline comments
 
@@ -1706,6 +1706,7 @@ int main(int argc, char **argv) {
 

	
 
			p.load(istream);
 
			p.setProperty("pid", boost::lexical_cast<std::string>(getpid()));
 
			p.setProperty("jid", CONFIG_STRING(&config, "service.jid"));
 
			log4cxx::PropertyConfigurator::configure(p);
 
		}
 

	
spectrum/src/backend-logging.cfg
Show inline comments
 
log4j.rootLogger=debug, R
 

	
 
log4j.appender.R=org.apache.log4j.RollingFileAppender
 
log4j.appender.R.File=/var/log/spectrum2/backends/backend-${pid}.log
 
log4j.appender.R.File=/var/log/spectrum2/${jid}/backends/backend-${pid}.log
 

	
 
log4j.appender.R.MaxFileSize=10000KB
 
# Keep one backup file
spectrum/src/logging.cfg
Show inline comments
 
log4j.rootLogger=debug, R
 

	
 
log4j.appender.R=org.apache.log4j.RollingFileAppender
 
log4j.appender.R.File=/var/log/spectrum2/spectrum2.log
 
log4j.appender.R.File=/var/log/spectrum2/${jid}/spectrum2.log
 

	
 
log4j.appender.R.MaxFileSize=10000KB
 
# Keep one backup file
spectrum/src/main.cpp
Show inline comments
 
@@ -20,9 +20,11 @@
 
#include <tchar.h>
 
#endif
 
#include "log4cxx/logger.h"
 
#include "log4cxx/consoleappender.h"
 
#include "log4cxx/patternlayout.h"
 
#include "log4cxx/propertyconfigurator.h"
 
#include "log4cxx/consoleappender.h"
 
#include "log4cxx/helpers/properties.h"
 
#include "log4cxx/helpers/fileinputstream.h"
 
#include "libgen.h"
 
#include <sys/stat.h>
 
 
@@ -218,7 +220,13 @@ int main(int argc, char **argv)
 
#endif
 
	}
 
	else {
 
		log4cxx::PropertyConfigurator::configure(CONFIG_STRING(&config, "logging.config"));
 
		log4cxx::helpers::Properties p;
 
		log4cxx::helpers::FileInputStream *istream = new log4cxx::helpers::FileInputStream(CONFIG_STRING(&config, "logging.config"));
 
 
		p.load(istream);
 
		p.setProperty("pid", boost::lexical_cast<std::string>(getpid()));
 
		p.setProperty("jid", CONFIG_STRING(&config, "service.jid"));
 
		log4cxx::PropertyConfigurator::configure(p);
 
	}
 
 
#ifndef WIN32
0 comments (0 inline, 0 general)