move log folder into caller folder if called with additional config file

This commit is contained in:
einhornimmond 2021-05-13 15:45:09 +02:00
parent 201590db7d
commit 4580bb15a0

View File

@ -134,6 +134,9 @@ int Gradido_LoginServer::main(const std::vector<std::string>& args)
#if defined(_WIN32) || defined(_WIN64) #if defined(_WIN32) || defined(_WIN64)
log_Path = "./"; log_Path = "./";
#endif #endif
if (mConfigPath != "") {
log_Path = "./";
}
// init speed logger // init speed logger
Poco::AutoPtr<Poco::SimpleFileChannel> speedLogFileChannel(new Poco::SimpleFileChannel(log_Path + "speedLog.txt")); Poco::AutoPtr<Poco::SimpleFileChannel> speedLogFileChannel(new Poco::SimpleFileChannel(log_Path + "speedLog.txt"));
@ -168,11 +171,11 @@ int Gradido_LoginServer::main(const std::vector<std::string>& args)
std::string cfg_Path = Poco::Path::config() + "grd_login/"; std::string cfg_Path = Poco::Path::config() + "grd_login/";
try { try {
if(mConfigPath != "") { if(mConfigPath != "") {
loadConfiguration(mConfigPath); loadConfiguration(mConfigPath);
} else { } else {
loadConfiguration(cfg_Path + "grd_login.properties"); loadConfiguration(cfg_Path + "grd_login.properties");
} }
} }
catch (Poco::Exception& ex) { catch (Poco::Exception& ex) {
errorLog.error("error loading config: %s", ex.displayText()); errorLog.error("error loading config: %s", ex.displayText());