Hi Acniv, Thanks for your feedback. Since I have not had a chance to get back to follow up on resolving this issue, I'd just post your comments back to this log4j user list for others' reference.
Regards, Shuh > -----Original Message----- > From: Acniv Fellhere [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 02, 2007 12:49 AM > To: CHANG Shuh > Subject: NTEventLogAppender with missing description source > for Windows Server 2003 > > > http://msdn2.microsoft.com/en-us/library/aa363652.aspx > > From what I read of the steps you took, it seems like you did > it all right. You used mc.exe, rc.exe and link.exe to create > a dll that contains your defined IDs. What most people miss, > and maybe you did not, it didn't say is that the actual IDs > passed are defined in the .h file. So once you finish > compiling the dll check into the .h file and use the > messageID values in there. Use the link above to read up on > it. Im a hack really with not many programming skills but if > I can figure it out so can you. I recommend downloading the > NT 4.0 res kit which has a program called logevent.exe in it > (Also avail in the win3k res kit Ive read). You can use it to > test your message file (dll) with. At least then you will > know if its your messge file, something goofy in the registry > or the way you are passing the messageID to the evenlog. Hope > this helps. > > -PC > _________________________________________________________________ > Get into the holiday spirit, chat with Santa on Messenger. > http://imagine-windowslive.com/minisites/santabot/default.aspx > ?locale=en-us > > -----Original Message----- > From: CHANG Shuh [mailto:[EMAIL PROTECTED] > Sent: Thursday, December 14, 2006 1:41 PM > To: Log4J Users List > Subject: RE: NTEventLogAppender with missing description > source for Windows Server 2003 > > 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] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
