Hi all - 

 

I've looked around on the web and through some message boards trying to find
if someone has already asked this question. I've read through the FAQ and I
don't think that I've seen this asked before.  Please excuse me if this
question HAS been asked before.

 

I'm creating a code base that will be shared between a web application
(running under tomcat) and a few standalone classes.  I would like
everyone's logging to share the same log files however.  I am developing on
a PC but my staging and production environments are both running Linux.

 

Also - I've set up my logs to rollover so that each new day will have its
own log. 

 

My issue pertains to the write permissions of the log files.  When the web
application logs first, the log file is created by the tomcat user (and in
the tomcat group) in my logs directory and it has only read permissions at
the group level and other level.  Only the tomcat user has read/write access
to the log file.  When the application that runs outside of tomcat executes
first (under a different username, btw), the logfile is created such that it
is owned by that user and again it has the same permissions.  

 

So I am wondering - Is it possible to configure log4j so that it will create
log files with group write permission by default?  

 

I have set my logging directory's sticky bit to have all new files be
created with the correct group.  The tomcat user and the non-tomcat user are
both in the same group.

 

Is logging via sockets the only way to resolve this kind of issue?  That
seems like overkill.

 

Thanks much and again - I'm sorry if I am repeating a question asked before.

 

William

 

William B. Noto    Open Finance    71 Gansevoort Street, Suite 2D, New York,
NY 10014
Tel  + 1 646 230 8666     Fax  + 1 646 230 8657 

 

Reply via email to