Uploaded image for project: 'Log4cxx'
  1. Log4cxx
  2. LOGCXX-348

DOMConfigurator configure method crashes with full path

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 0.10.0
    • Fix Version/s: None
    • Component/s: Configurator
    • Labels:
      None
    • Environment:
      Windows Visual Studio 2005 on Windows XP SP2

      Description

      The DOMConfigurator does not appear to accept full-paths with the configure function. I do not know if this is by design or not but I thought it was a bug.

      I did one test using the xml filename alone as you see below. The xml file in this test was located in the current working directory. This call works.
      log4cxx::xml::DOMConfigurator::configure("log4cxx.xml");

      I did another test (the one that I would like to work) using the full path to the xml filename as follows. This call does not work.
      std::string fullPath = "c:/program files/myapp/log4cxx.xml";
      log4cxx::xml::DOMConfigurator::configure(fullPath);

      An exception was being thrown and I figured out why. The following function is what i'm calling into in DOMConfigurator.cpp:

      void DOMConfigurator::configure(const std::string& filename)
      {
      // String value of filename here: C:/Program Files/MyApp/log4cxx.xml
      File file(filename);
      // file.getPath().c_str() value here: C
      DOMConfigurator().doConfigure(file, LogManager::getLoggerRepository());
      }

      It appears the file object is truncating the path and hence the call to apr_open_file following in doConfigure is crashing.

      Is this by design?

        Attachments

          Activity

            People

            • Assignee:
              carnold@apache.org Curt Arnold
              Reporter:
              josepharmbruster Joseph Armbruster
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: