Page 1 of 1

FileChannel of Logger in Visual Studio 2010

Posted: 16 Dec 2013, 14:42
by akeyliu
Hi, I'm using Visual Studio 2010 professional + Poco 1.4.6p2 in windows(win7 32).
And, I'm developing a Http Server using Poco::Net::HttpServer to accept HTTP request and send back HTTP Response.
The Http Server using windows console type of application.
But Only console logger will display the debug info NOT FileChannel.

Buiding Parameters for Visual Studio 2010 is Debug Win32 with command line compile format is :

"/ZI /nologo /W3 /WX- /Od /Oy- /D "WIN32" /D "_CONSOLE" /D "_DEBUG" /D "DEBUG" /D "WINVER=0x0601" /D "_WINDOWS" /D "POCO_STATIC" /D "_MBCS" /D "_UNICODE" /D "UNICODE" /Gm- /EHsc /RTC1 /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fp"Debug\LOS.pch" /Fa"Debug\" /Fo"Debug\" /Fd"Debug\vc100.pdb" /Gd /analyze- /errorReport:queue "

major source code of logger are list below. Any idea for only console not FileChannel is work? Thanks.

#define LOS_LOGGER "FileLogger"

#define DEBUGSTR(s); {\
ostringstream o; \
LocalDateTime now; \
o << "[" << DateTimeFormatter::format(now, DateTimeFormat::SORTABLE_FORMAT) << "] [" << Process::id() << "][" << Thread::currentTid() << "][DEBUG][" << __FILE__ << "][" << __LINE__ << "][" << s << "]";\
int main(int argc, char**argv)
std::string strLogFileName;

AutoPtr<SplitterChannel> splitterChannel(new SplitterChannel());
AutoPtr<Channel> consoleChannel(new ConsoleChannel());
AutoPtr<Channel> fileChannel(new FileChannel(strLogFileName));
fileChannel->setProperty("rotation", "100");
fileChannel->setProperty("archive", "timestamp");
AutoPtr<Formatter> formatter(new PatternFormatter("%h-%M-%S.%i: %t"));
AutoPtr<Channel> formattingChannel(new FormattingChannel(formatter, splitterChannel));


#if defined DEBUG
Logger& fileLogger = Logger::create(LOS_LOGGER, formattingChannel, Message::PRIO_DEBUG);
Logger& fileLogger = Logger::create(LOS_LOGGER, formattingChannel, Message::PRIO_INFORMATION);

LosHttpServer httpServer;
return(, argv));