tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "USHAKOV, Sergey" <s.usha...@chemitech.ru>
Subject Re: Placing a webapp log file aside by other server log files
Date Tue, 05 Jul 2011 02:20:16 GMT

----- Original Message ----- 
From: "Mark Eggers" <its_toasted@yahoo.com>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Monday, July 04, 2011 1:27 AM
Subject: Re: Placing a webapp log file aside by other server log files


> ----- Original Message -----
>
>> From: "USHAKOV, Sergey" <s.ushakov@chemitech.ru>
>> To: users@tomcat.apache.org
>> Cc:
>> Sent: Sunday, July 3, 2011 12:51 PM
>> Subject: Placing a webapp log file aside by other server log files
>>
>> Hi all,
>>
>> I am looking for a robust way to get a webapp-specific log file be placed 
>> in the
>> same directory where all the other server logs go.
>>
>> Using a line like "org.apache.juli.FileHandler.directory =
>> ${catalina.base}/logs" in the webapp's "logging.properties"
>> does not do the job, as server logs location may be changed from
>> ${catalina.base}/logs to something else by the server's
>> "logging.properties".
>>
>> Any ideas?
>>
>> Thanks and best regards,
>> Sergey
>
>
> This is probably not the best way, since it will require you to configure 
> information in two places (and keep it in sync). However, it should work.
>
> In $CATALINA_BASE/bin/setenv.sh add something like the following to your 
> JAVA_OPTS:
>
> JAVA_OPTS="-Dwebapp.logs=some-directory"
> EXPORT JAVA_OPTS
>
> In your web application's logging.properties reference 
> ${webapp.logs}/some-file.
>
> This seems to work reasonably well for me using log4j and commons-logging.
>
> . . . . just my two cents.
>
> /mde/
>

Thank you Mark. Though that does not look like a solution I might be willing 
to get :) , this will definitety do the job if no other solution is found...

Thanks again,
Sergey 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message