logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "peter kwong" <l...@writeme.com>
Subject Re: Help needed regarding log4cxx
Date Mon, 25 May 2009 18:12:42 GMT
 Mehrwash,
  The activateOptions() needs a parameter:

    log4cxx::helpers::Pool p;  // buffer pool that for activateOptions()
to use
    fa->activateOptions(p);


peter

  ----- Original Message -----
  From: "Mehrwash Faruqi"
  To: log4cxx-user@logging.apache.org
  Subject: Help needed regarding log4cxx
  Date: Thu, 21 May 2009 09:52:03 +0500






      Hello
      i would really appreciate it if you could send the steps
      needed to initialize a logger with rolling fileappender
      useing the C++ classes. I have been doing it with the
      configuration file but now the program needs to be shifted
      towards the C++ classes.
      i tried using the steps given below.


      logger = Logger::getLogger("MyTesting");
          LayoutPtr layout = new PatternLayout("[%c] [%d]: [%p]
      %m\n");
          logger->setLevel(log4cxx::Level::DEBUG);

          RollingFileAppenderPtr appender = new
      RollingFileAppender(layout, "mehrs_log", true);
          appender->setMaxFileSize("100KB");
          appender->setMaxBackupIndex(10);
          appender->activateOptions();

          logger->addAppender(appender);
          logger->warn("debuggging");
          LOG4CXX_WARN(logger,"Started ");

      The error i get is :
      Program received signal SIGSEGV, Segmentation fault.
      0x00002aaaaad8aa4e in
      log4cxx::helpers::AppenderAttachableImpl::appendLoopOnAppenders
      (this=<value optimized out>,event=@0x7fff44f6a5c0) at
      ../include/log4cxx/helpers/objectptr.h:109
      109     ../include/log4cxx/helpers/objectptr.h: No such file
      or directory.
              in ../include/log4cxx/helpers/objectptr.h

      I am using the version: log4cxx-0.9.7 ( cant update..uptil
      now was reading the .conf file using propertyconfigurator..)
      Operating System: Linux.
      --
      Mehrwash Faruqi




    --
    Mehrwash Faruqi




  --
  Mehrwash Faruqi

-- 
Be Yourself @ mail.com!
Choose From 200+ Email Addresses
Get a Free Account at www.mail.com


Mime
View raw message