Hi Curt, Thanks for the detailed description of the issue, and I apologize if I had misinterpreted your earlier response.
I did not have a chance to try to build the DLL file at all -- don't even have the proper compilation environment yet. I was hoping that there might be some quick work around to patch the registry directtly, but I think you are right that it's better to get to the root cause of the problem -- get the code fixed to properly register the NTEventLogAppender.dll. I don't know if I have enough spare time to look further into the source code for a fix. If someone knows the code better for a proper fix, that'll be greatly appreciated. Of course, if I eventually had the time and figured it out for a solution, I definitely would be glad to post it back. Thanks once again for your insights. - Shuh > -----Original Message----- > From: Curt Arnold [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 13, 2006 2:14 PM > To: Log4J Users List > Subject: Re: NTEventLogAppender with missing description > source for Windows Server 2003 > > I believe that you misinterpreted my response. The log4j > package does include all files necessary to rebuild > NTEventLogAppender.dll, it is not missing any files. If you > run the ant target "build.nt.dll" on Windows with MinGW on > the path (I believe that I use MinGW 3.1 or 3.1.1), > NTEventLogAppender.dll will be built. It appears that you > were attempting to build the appender without using the build > script and did not use javah to create the supposedly missing > header files corresponding to the java classes > org.apache.log4j.nt.NTEventLogAppender and org.apache.log4j.Priority. > > regsvr32 does not find a DllRegisterServer in > NTEventLogAppender.dll since that entry point was never > written. Just having a DllRegisterServer entry point would > satisfy regsvr32, but it would not address the unregistered > message file issues. > > To enhance the NTEventLogAppender.dll to address your > observed complaints, a DllRegisterServer and > DllUnregisterServer entry points would need to be added to > NTEventLogAppender.dll. The implementation of > DllRegisterServer would need to determine the full path to > NTEventLogAppender.dll using GetModuleFileName() and then > would need to register the DLL as a message source as > described in http:// > msdn2.microsoft.com/en-us/library/aa363661.aspx. The DLL > does appear to contain the necessary message resource, it > just doesn't appear to have any code that attempts to > register itself. What you are experiencing is exactly what is > described at the bottom of that page. > > > An application can use the Application log without adding a > new event > > source to the registry. If the application calls > RegisterEventSource, > > passing a source name that cannot be found in the registry, the > > event-logging service uses the Application log by default. However, > > because there are no message files, the Event Viewer cannot map any > > event identifiers or event categories to a description string, and > > will display an error. For this reason, you should add a > unique event > > source to the registry for your application and specify a message > > file. > > To recap: > > 1. log4j 1.2.14 isn't missing any files. The files that you > thought were missing are generated using javah in the build > script. If you don't use the build script, you have to > manually perform all the steps in to compile the message > files, resource files, and generate the header files > corresponding to the needed java classes. > 2. The observed behavior isn't a regression. That is, it > didn't stop working, it just never had the necessary code to > implement registering itself as an event source. > 3. The observed behavior isn't desirable. A patch that added > a DllRegisterServer entry point to make the appropriate > registry entries would be a helpful contribution as an > enhancement. If anyone would like to take a shot and > contribute your work, create a new bug in Bugzilla and then > after creating the bug attach a patch file. > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
