Yin Gang wrote:
> Hi!
> 
> I've used log4cxx in some console aps and it's all ok. Then this time
> I want to use it in a windows service and some problems came out...

I have no problem using log4cxx in a service application.

> If I put the following line in the service's main(), the service would
> fail to start immediately:
> 
> PropertyConfigurator::configure("E:\\Works\\testService\\log4j.properties");

Does the account, that the service is using, have the needed access
rights for this file? Which account are you using? There are 3
predefined service accounts: LocalSystem, LocalService and
NetworkService, each with different default access rights.

You can use sysinternals filemon to watch the service access your
properties file and see if it succeeds or not.

My guess is that it doesn't succeed when runngin as a service...

Regards, Peter
-- 
    _   _        Peter Steiner <[EMAIL PROTECTED]>
  / /_/ /        Hug-Witschi AG <http://www.hugwi.ch/>
 /  _  /         Electronic Engineering
/_/ /_/  _   _   Auriedstrasse 10
   / / / / / /   CH-3178 Boesingen
  / /_/ /_/ /    Tel  +41 31 740 44 44
 /_ _ _ _ _/     Fax  +41 31 740 44 45

Reply via email to