RE: [OT] log4j file path issue

2003-04-03 Thread apachep2
I use ${catalina.home} and now I can get rid of my extra
log4j.unix.properties. Thx, Tim.

-Original Message-
From: Tim Shadel [mailto:[EMAIL PROTECTED] 
Sent: April 2, 2003 11:03 PM
To: Struts Users Mailing List
Subject: Re: [OT] log4j file path issue

I think this works.

A quick look at the Log4j list (like Craig suggested) turned up these 
threads:

These seem to hit the suggestions already offered:

http://www.mail-archive.com/[EMAIL PROTECTED]/msg08056.html
http://www.mail-archive.com/[EMAIL PROTECTED]/msg06026.html

This one seems to be the most interesting:

http://www.mail-archive.com/[EMAIL PROTECTED]/msg05432.html

It appears that you can use ${some-system-property} in your config 
files.  We do something similar to you, so I just tried this on our 
setup and it worked:

log4j.appender.A1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A1.DatePattern='-'-MM-dd
log4j.appender.A1.File=${catalina.base}/logs/my.log

I took advantage of the -Dcatalina.base property already defined in 
the catalina.sh file used to start Tomcat.  If you'd like to use a 
custom System property this URL

http://jakarta.apache.org/log4j/docs/manual.html#defaultInit

describes how to set log4j properties using the CATALINA_OPTS 
environment variable, though I'm sure there are sources that give more 
direct instructions for setting System properties for Tomcat.

Hope that helps,

Tim

P.S.  I suppose this should get posted to Log4j's list too; but I'm also

too lazy to go through the signup process and setup mail filters. :-)

Dan Allen wrote:
 *This message was transferred with a trial version of CommuniGate(tm)
Pro*
 I am working with a jsp developer who uses windows, where I use
 linux.  When he checks out a copy of the application in the revision
 system, the log4j.properties file is not playing fair.  I have in it
 
 log4j.appender.default.File=/var/tomcat4/logs/struts.log
 
 But his path to tomcat is not the same.  If I try to do
 
 log4j.appender.default.File=struts.log
 
 then in linux it tries to make the file in / and doesn't understand
 relative paths. (Note: I am initializing log4j.properties in a init
 servlet like suggested in the manual).
 
 How do I specify that I want the log file in the logs directory of
 the tomcat installation.  Even if I have to set something in the
 init servlet, I will do that, but HOW HOW HOW???  argh...apart from
 having 2 log4j.properties files.
 
 Dan
 



-
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]



RE: [OT] log4j file path issue

2003-04-02 Thread apachep2
I want to know too. Currently I use 2 properties files, one for win32,
one for linux. When I build my app, I let ant detect which to use.

-Original Message-
From: Dan Allen [mailto:[EMAIL PROTECTED] 
Sent: April 2, 2003 5:05 PM
To: Struts-User List
Subject: [OT] log4j file path issue

I am working with a jsp developer who uses windows, where I use
linux.  When he checks out a copy of the application in the revision
system, the log4j.properties file is not playing fair.  I have in it

log4j.appender.default.File=/var/tomcat4/logs/struts.log

But his path to tomcat is not the same.  If I try to do

log4j.appender.default.File=struts.log

then in linux it tries to make the file in / and doesn't understand
relative paths. (Note: I am initializing log4j.properties in a init
servlet like suggested in the manual).

How do I specify that I want the log file in the logs directory of
the tomcat installation.  Even if I have to set something in the
init servlet, I will do that, but HOW HOW HOW???  argh...apart from
having 2 log4j.properties files.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, [EMAIL PROTECTED]
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Windows: where do you want your data to disappear to today?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

-
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]



Re: [OT] log4j file path issue

2003-04-02 Thread Dan Allen
apachep2 ([EMAIL PROTECTED]) wrote:

 I want to know too. Currently I use 2 properties files, one for win32,
 one for linux. When I build my app, I let ant detect which to use.

That was one solution I was thinking of but seems pretty lame to
have to do.  Unfortunately my JSP developer isn't building anything
(just editing jsp files) so he won't be running ant at all.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, [EMAIL PROTECTED]
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
I used to herd dairy cows.  Now I herd linux users.  Apart 
from the isolation, I think I preferred the cows.  They were 
better in conversation, easier to milk, and if they annoyed me 
enough, I could shoot them and eat them.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] log4j file path issue

2003-04-02 Thread Craig R. McClanahan


On Wed, 2 Apr 2003, Dan Allen wrote:

 Date: Wed, 2 Apr 2003 16:04:54 -0600
 From: Dan Allen [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: Struts-User List [EMAIL PROTECTED]
 Subject: [OT] log4j file path issue

 I am working with a jsp developer who uses windows, where I use
 linux.  When he checks out a copy of the application in the revision
 system, the log4j.properties file is not playing fair.  I have in it

 log4j.appender.default.File=/var/tomcat4/logs/struts.log

 But his path to tomcat is not the same.  If I try to do

 log4j.appender.default.File=struts.log

 then in linux it tries to make the file in / and doesn't understand
 relative paths. (Note: I am initializing log4j.properties in a init
 servlet like suggested in the manual).

 How do I specify that I want the log file in the logs directory of
 the tomcat installation.  Even if I have to set something in the
 init servlet, I will do that, but HOW HOW HOW???  argh...apart from
 having 2 log4j.properties files.


Sounds like a good question for the Log4J user list :-).

 Dan


Craig

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] log4j file path issue

2003-04-02 Thread Dan Allen
 Sounds like a good question for the Log4J user list :-).
True true, but sometimes I through in an [OT] just not to have to join
yet another mailinglist to post a question.  I am already on like 12
mailinglists and sometimes it is a bit of a barrier to asking a
question to have to join and setup the mail filters.  I guess such
is life because of spammers.  Security sux sometimes.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, [EMAIL PROTECTED]
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Windows: where do you want your data to disappear to today?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]