I'll try all of these things, but I do believe that the privileges are OK, since something like:
Service.exe /service params Run from the command prompt logs fine, creating the file in the place I'd expect it to be. I already suspected that it didn't know where to resolve the configuration file, so I used an explicit path (C:\\....\\configuration.xml), so I don't think that's the issue. I also leave the logger reference around, so I'm actually using the same Logger variable the second time (when it fails) as I did when it worked the first time (from the command line). BTW, I'm using CVS HEAD from about 2/22. Myron Drapal [EMAIL PROTECTED] (303) 538-3513 -----Original Message----- From: Curt Arnold [mailto:[EMAIL PROTECTED] Sent: Monday, March 14, 2005 6:03 PM To: Log4CXX User Subject: Re: Logging from a Windows Service Not enough information to go on really. Are you using 0.9.7 or CVS HEAD? Are you using relative paths in your configuration? They might be getting resolved to unexpected paths. Have you tried using OutputDebugAppender and monitoring the service with DebugView (http://www.sysinternals.com/ntw2k/freeware/debugview.shtml) or other Debug monitor? That would at least allow you to check that configuration works as expected and then progress to figuring out why a particular appender isn't working as expected. log4cxx doesn't do any trickery with privileges, the process has to have the rights to create and write to the log file. On Mar 14, 2005, at 6:36 PM, Drapal, Myron E (Myron) wrote: > Has anyone tried to log from a Windows Service? It seems to work if > the service is started from the command line, but if the log entries > are generated after the service is started (via the Control Panel > Services Applet), the logs are not written. I think that this is most > likely a security policy problem, but don't know what security context > that log4cxx is expecting (i.e. does it set the security context > anywhere, what permissions does it expect to have when the files are > created/written)? > > > > Myron Drapal > > [EMAIL PROTECTED] > > > <Drapal, Myron E (Myron).vcf>
BEGIN:VCARD VERSION:2.1 N:Drapal;Myron FN:Drapal, Myron E (Myron) ORG:AICS;30004407 TEL;WORK;VOICE:+1 303 538 3513 ADR;WORK:;d1-b21;1300 West 120th Avenue;Westminster;CO;80234-2726;U S LABEL;WORK;ENCODING=QUOTED-PRINTABLE:d1-b21=0D=0A1300 West 120th Avenue=0D=0AWestminster, CO 80234-2726=0D=0AU S EMAIL;PREF;INTERNET:[EMAIL PROTECTED] REV:20040910T164408Z END:VCARD