More debugging showed where the error was:
In the misc.c around line 161
FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal)
{
if (!lateDllHandle[fnLib]) {
lateDllHandle[fnLib] = LoadLibrary(lateDllName[fnLib]);
if (!lateDllHandle[fnLib])
return NULL;
}
if (ordinal)
return GetProcAddress(lateDllHandle[fnLib], (char *) ordinal);
else
return GetProcAddress(lateDllHandle[fnLib], fnName);
}
The LoadLibrary("kernel32") returned NULL, which caused the problem.
The error code is 126, can not find the module kernel32 ? why it can not
find the kernel32.dll, it is in the c:\windows\system32 ...
Anyone can help me out?
Thanks,
Lijuan
On Thu, Apr 9, 2009 at 12:23 PM, Lijuan Zhu <[email protected]> wrote:
>
>
> On Thu, Apr 9, 2009 at 12:03 PM, Curt Arnold <[email protected]> wrote:
>
>> Try using forward slashes in the file name. If that doesn't work, start
>> with a file no directory specification. log4cxx uses APR which provides a
>> consistent API above the filesystem including trying to provide a consistent
>> file specification format (as does Java) and takes forward slashes on all
>> platforms.
>>
>> If you are using the property configuration, backslashes are escape
>> sequences and will get mangled (double backslashes should work fine).
>> Wouldn't think it would affect you if you were using XML configuration.
>>
>> The file open is in src/fileoutputstream.cpp around line 54.
>
>
> I tried to debug into it, but did not hit the breakpoint into
> src/fileoutputstream.cpp
>
> This is my call stack: (failed in GetFileAttributesExW, because the file
> does not exist ...)
>
> > pslog.dll!apr_winapi_GetFileAttributesExW(const unsigned short *
> lpFileName=0x001286e8, _GET_FILEEX_INFO_LEVELS
> fInfoLevelId=GetFileExInfoStandard, void * lpFileInformation=0x00128494)
> Line 204 + 0x3a bytes C
> pslog.dll!apr_stat(apr_finfo_t * finfo=0x0012c760, const char *
> fname=0x0188c500, int wanted=256, apr_pool_t * pool=0x0188c040) Line 496 +
> 0x15 bytes C
> pslog.dll!log4cxx::File::length(log4cxx::helpers::Pool & pool={...})
> Line 171 + 0x24 bytes C++
>
>
> pslog.dll!log4cxx::rolling::RollingFileAppenderSkeleton::activateOptions(log4cxx::helpers::Pool
> & p={...}) Line 106 + 0xc bytes C++
>
>
> pslog.dll!log4cxx::RollingFileAppender::activateOptions(log4cxx::helpers::Pool
> & pool={...}) Line 153 C++
>
> pslog.dll!log4cxx::config::PropertySetter::activate(log4cxx::helpers::Pool
> & p={...}) Line 102 + 0x37 bytes C++
>
> pslog.dll!log4cxx::xml::DOMConfigurator::parseAppender(log4cxx::helpers::Pool
> & p={...}, log4cxx::helpers::ObjectPtrT<log4cxx::helpers::CharsetDecoder> &
> utf8Decoder={...}, apr_xml_elem * appenderElement=0x01891a40, apr_xml_doc *
> doc=0x01891100,
> std::map<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> >,log4cxx::helpers::ObjectPtrT<log4cxx::Appender>,std::less<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> >
> >,std::allocator<std::pair<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> > const ,log4cxx::helpers::ObjectPtrT<log4cxx::Appender> > > > &
> appenders=[0]()) Line 264 C++
>
>
> pslog.dll!log4cxx::xml::DOMConfigurator::findAppenderByName(log4cxx::helpers::Pool
> & p={...}, log4cxx::helpers::ObjectPtrT<log4cxx::helpers::CharsetDecoder> &
> utf8Decoder={...}, apr_xml_elem * element=0x01891a40, apr_xml_doc *
> doc=0x01891100, const
> std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> > & appenderName="MyRollingAppenderSize",
> std::map<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> >,log4cxx::helpers::ObjectPtrT<log4cxx::Appender>,std::less<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> >
> >,std::allocator<std::pair<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> > const ,log4cxx::helpers::ObjectPtrT<log4cxx::Appender> > > > &
> appenders=[0]()) Line 131 + 0x23 bytes C++
>
>
> pslog.dll!log4cxx::xml::DOMConfigurator::findAppenderByName(log4cxx::helpers::Pool
> & p={...}, log4cxx::helpers::ObjectPtrT<log4cxx::helpers::CharsetDecoder> &
> utf8Decoder={...}, apr_xml_elem * element=0x01891918, apr_xml_doc *
> doc=0x01891100, const
> std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> > & appenderName="MyRollingAppenderSize",
> std::map<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> >,log4cxx::helpers::ObjectPtrT<log4cxx::Appender>,std::less<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> >
> >,std::allocator<std::pair<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> > const ,log4cxx::helpers::ObjectPtrT<log4cxx::Appender> > > > &
> appenders=[0]()) Line 135 + 0x2a bytes C++
>
>
> pslog.dll!log4cxx::xml::DOMConfigurator::findAppenderByReference(log4cxx::helpers::Pool
> & p={...}, log4cxx::helpers::ObjectPtrT<log4cxx::helpers::CharsetDecoder> &
> utf8Decoder={...}, apr_xml_elem * appenderRef=0x0188c438, apr_xml_doc *
> doc=0x01891100,
> std::map<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> >,log4cxx::helpers::ObjectPtrT<log4cxx::Appender>,std::less<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> >
> >,std::allocator<std::pair<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> > const ,log4cxx::helpers::ObjectPtrT<log4cxx::Appender> > > > &
> appenders=[0]()) Line 159 + 0x29 bytes C++
>
>
> pslog.dll!log4cxx::xml::DOMConfigurator::parseChildrenOfLoggerElement(log4cxx::helpers::Pool
> & p={...}, log4cxx::helpers::ObjectPtrT<log4cxx::helpers::CharsetDecoder> &
> utf8Decoder={...}, apr_xml_elem * loggerElement=0x0188c330,
> log4cxx::helpers::ObjectPtrT<log4cxx::Logger> logger={...}, bool
> isRoot=true, apr_xml_doc * doc=0x01891100,
> std::map<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> >,log4cxx::helpers::ObjectPtrT<log4cxx::Appender>,std::less<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> >
> >,std::allocator<std::pair<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> > const ,log4cxx::helpers::ObjectPtrT<log4cxx::Appender> > > > &
> appenders=[0]()) Line 463 + 0x20 bytes C++
>
> pslog.dll!log4cxx::xml::DOMConfigurator::parseRoot(log4cxx::helpers::Pool &
> p={...}, log4cxx::helpers::ObjectPtrT<log4cxx::helpers::CharsetDecoder> &
> utf8Decoder={...}, apr_xml_elem * rootElement=0x0188c330, apr_xml_doc *
> doc=0x01891100,
> std::map<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> >,log4cxx::helpers::ObjectPtrT<log4cxx::Appender>,std::less<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> >
> >,std::allocator<std::pair<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> > const ,log4cxx::helpers::ObjectPtrT<log4cxx::Appender> > > > &
> appenders=[0]()) Line 436 C++
> pslog.dll!log4cxx::xml::DOMConfigurator::parse(log4cxx::helpers::Pool
> & p={...}, log4cxx::helpers::ObjectPtrT<log4cxx::helpers::CharsetDecoder> &
> utf8Decoder={...}, apr_xml_elem * element=0x01891918, apr_xml_doc *
> doc=0x01891100,
> std::map<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> >,log4cxx::helpers::ObjectPtrT<log4cxx::Appender>,std::less<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> >
> >,std::allocator<std::pair<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> > const ,log4cxx::helpers::ObjectPtrT<log4cxx::Appender> > > > &
> appenders=[0]()) Line 938 C++
> pslog.dll!log4cxx::xml::DOMConfigurator::doConfigure(const
> log4cxx::File & filename={...},
> log4cxx::helpers::ObjectPtrT<log4cxx::spi::LoggerRepository> &
> repository1={...}) Line 742 C++
> pslog.dll!log4cxx::xml::DOMConfigurator::configure(const
> std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>
> > & filename="d:\SVN\projectwise\ncpe\bin\tf.log.xml") Line 756 + 0x64
> bytes C++
>
>
>>
>>
>>
>> On Apr 8, 2009, at 10:30 PM, Lijuan Zhu wrote:
>>
>> I am new to log4cxx, and just got it set up into my application. I
>>> configured a xml file for the logging, but the log file like c:\temp.log
>>> could not be created by the log4cxx. I am sure my app has the privelegesto
>>> create file.
>>> I would like to debug the source code, would someone please point me to
>>> the source code?
>>>
>>> Thanks,
>>> Lijuan
>>>
>>
>>
>