Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Cannot Reproduce
-
0.10.0
-
None
-
None
-
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?