diff --git a/spectrum/src/main.cpp b/spectrum/src/main.cpp index 299495346d965fbe6e8d7718daa4ad2fb426f1a5..bc1b42136daa7a829534fa6f068961082177a833 100644 --- a/spectrum/src/main.cpp +++ b/spectrum/src/main.cpp @@ -20,9 +20,11 @@ #include #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 @@ -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(getpid())); + p.setProperty("jid", CONFIG_STRING(&config, "service.jid")); + log4cxx::PropertyConfigurator::configure(p); } #ifndef WIN32