|
|
Choosing A Webhost: |
DailyRollingFileAppender doesn't work gcc 3.2.2 RHEL3: msg#00046apache.logging.log4cxx.user
$trivial log4j.xml $log4cxx: No output stream or file set for the appender named [DATE_LOGFILE]. I am using the trial.cpp under example dir to test. the only change I made is to use "xml::DOMConfigurator::configure(argv[1])", instead of "BasicConfigurator::configure()". log4j.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="DATE_LOGFILE" class="org.apache.log4j.DailyRollingFileAppender"> <param name="Append" value="true" /> <param name="File" value="log4cxx.test.log" /> <param name="datePattern" value="'.'yyyy-MM-dd" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/> </layout> </appender> <root> <priority value="DEBUG"/> <appender-ref ref="DATE_LOGFILE"/> </root> </log4j:configuration> trivial.cpp: #include <log4cxx/logstring.h> #include <stdlib.h> #include <log4cxx/logger.h> #include <log4cxx/basicconfigurator.h> #include <log4cxx/xml/domconfigurator.h> #include <log4cxx/helpers/exception.h> #include <log4cxx/ndc.h> using namespace log4cxx; using namespace log4cxx::helpers; namespace { LoggerPtr logger = Logger::getRootLogger(); } int main(int argc, char *argv[]) { int result = EXIT_SUCCESS; try { if (argc > 1) { // BasicConfigurator replaced with PropertyConfigurator. xml::DOMConfigurator::configure(argv[1]); } else { BasicConfigurator::configure(); } NDC::push("trivial context"); LOG4CXX_DEBUG(logger, "debug message"); LOG4CXX_INFO(logger, "info message"); LOG4CXX_WARN(logger, "warn message"); LOG4CXX_ERROR(logger, "error message"); LOG4CXX_FATAL(logger, "fatal message"); NDC::pop(); } catch(std::exception&) { result = EXIT_FAILURE; } return result; } I tried the same log4j.xml with log4j-1.2.14.jar and java code works. anyone has a successful example for log4cxx DailyRollingFileAppender? thanks in advance for any help. -- View this message in context: http://www.nabble.com/DailyRollingFileAppender-doesn%27t-work-gcc-3.2.2-RHEL3-tf2510954.html#a7002628 Sent from the Log4cxx - Users mailing list archive at Nabble.com.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Nicolas Bastien est absent(e)., Nicolas Bastien |
|---|---|
| Next by Date: | RE: DailyRollingFileAppender doesn't work gcc 3.2.2 RHEL3, Jing Zheng |
| Previous by Thread: | Nicolas Bastien est absent(e)., Nicolas Bastien |
| Next by Thread: | RE: DailyRollingFileAppender doesn't work gcc 3.2.2 RHEL3, Jing Zheng |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |