Index: src/ch/ch.cpp =================================================================== diff -u -N -rffbc773697bd08220163bf1e4491a34376b0f61c -rb8b97b70743c49fcc2aee0db4cb7118db5e26dab --- src/ch/ch.cpp (.../ch.cpp) (revision ffbc773697bd08220163bf1e4491a34376b0f61c) +++ src/ch/ch.cpp (.../ch.cpp) (revision b8b97b70743c49fcc2aee0db4cb7118db5e26dab) @@ -307,15 +307,16 @@ } // ================================= Logging ======================================== - m_logInitializer.Init(5, 1 * 1024 * 1024); // #todo - m_chEngine.Init(5, 1 * 1024 * 1024); + InitLoggers(strPath); - chcore::TMultiLoggerConfigPtr spLoggerConfig = std::make_shared(); // #todo + // logger config + chcore::TMultiLoggerConfigPtr spAppLoggerConfig = std::make_shared(); + spAppLoggerConfig->SetLogLevel(L"default", (boost::log::trivial::severity_level)GetPropValue(rCfg)); // initialize the global log file if it is requested by configuration file CString strLogPath = strPath + _T("\\ch.log"); - m_spLogFactory.reset(new chcore::TLoggerFactory(chcore::PathFromString(strLogPath), spLoggerConfig)); + m_spLogFactory.reset(new chcore::TLoggerFactory(chcore::PathFromString(strLogPath), spAppLoggerConfig)); m_spLog = m_spLogFactory->CreateLogger(L"App"); LOG_INFO(m_spLog) << _T("============================ Initializing Copy Handler ============================"); @@ -495,6 +496,20 @@ return true; } +void CCopyHandlerApp::InitLoggers(const CString& strBasePath) +{ + chcore::TConfig& rConfig = GetConfig(); + + int iMaxSize = GetPropValue(rConfig); + int iRotateCount = GetPropValue(rConfig); + + m_logInitializer.Init(chcore::PathFromString(strBasePath), iRotateCount, iMaxSize); + + chcore::TSmartPath pathTasks = chcore::PathFromString(strBasePath); + pathTasks += chcore::PathFromString(L"Tasks"); + m_chEngine.Init(pathTasks, iRotateCount, iMaxSize); +} + void CCopyHandlerApp::InitShellExtension() { // validate ch version against extension version