+ // set working directory - fall back on application.dir if working directory isn't set\r
+ // if we are runing as a service, then working directory needs to be set to the application directory\r
+ if(m_workingdirectory=="" || config().getBool("application.runAsService",false)==true)\r
+ {\r
+ m_workingdirectory=config().getString("application.dir");\r
+ }\r
+ int rval=chdir(m_workingdirectory.c_str());\r
+\r
+#ifdef QUERY_LOG\r
+ {\r
+ Poco::AutoPtr<Poco::FormattingChannel> formatter=new Poco::FormattingChannel(new Poco::PatternFormatter("%Y-%m-%d %H:%M:%S | %t"));\r
+ Poco::AutoPtr<Poco::FileChannel> fc=new Poco::FileChannel("query.log");\r
+ fc->setProperty("rotation","daily");\r
+ fc->setProperty("times","utc");\r
+ fc->setProperty("archive","timestamp");\r
+ fc->setProperty("purgeCount","5");\r
+ fc->setProperty("compress","true");\r
+ formatter->setChannel(fc);\r
+ Poco::Logger::create("querylog",formatter,Poco::Message::PRIO_INFORMATION);\r
+ }\r
+#endif\r