I am using apache log4j from java 1.6.
I am creating exe file using exe4j and when I place it in the production folders -
logs are being created successfully.
Now, I have turned it into service exe
(checked a "service" checkbox in exe4j and installed it with SC command )
and log files stopped being created .
is there an explanation/solution for it ? Thanks.
Your service most likely is running as an account (LOCAL SERVICE?) that does not have permission to write to the log folder.
To check the account under the service is running on, right-click the service in the Services panel, select Properties, and view the LogOn tab (for Windows 7... exact steps for other Windows versions will vary but the idea is the same).
I would suggest continuing to run your service with the least privileges it needs and modify access rights to the log folder to allow the account the service is running under to write to that folder (Principal of Least Privilege). Of course, don't have anything except logs in that folder.