File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Different log files for different services in tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Different log files for different services in tomcat" Watch "Different log files for different services in tomcat" New topic
Author

Different log files for different services in tomcat

naveen jain
Greenhorn

Joined: Oct 02, 2008
Posts: 16
Hi,

I have three services in my one instance of tomcat , running on different ports and different applications are running on these different ports. Now i wants that logs for these different services (port) should be written in different files instead of only one logs/Catalina.out file.

is it possible..?

here is my server.xml file::::


<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">

<Listener className="org.apache.catalina.core.AprLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>

<GlobalNamingResources>
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />

<Resource
name="jdbc/pinstg"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
password="pin"
maxIdle="2"
maxWait="5000"
removeAbandoned="true"
logAbandoned="true"
validationQuery="select * from account_t where account_no='7792'"
username="pin"
url="jdbcracle:thin:@172.16.1.23:1521:pindb"
removeAbandonedTimeout="60"
maxActive="10"/>
<Resource
name="jdbc/wfps"
type="javax.sql.DataSource"
password="wfpsstg"
driverClassName="oracle.jdbc.OracleDriver"
maxIdle="2"
maxWait="5000"
removeAbandoned="true"
logAbandoned="true"
validationQuery="select obj_id from test"
username="wfpsstg"
url="jdbcracle:thin:@172.16.1.13:1521:appsdb"
removeAbandonedTimeout="60"
maxActive="10"/>

</GlobalNamingResources>

<Service name="Catalina">
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />

<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreFile="/.keystore" keystorePass="changeit" />
<Connector port="8009"
enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />

<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
</Engine>
</Service>

<Service name="CatalinaSecond">
<Connector port="8081" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
<Connector port="8009"
enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
<Engine name="CatalinaSecond" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Host name="localhost" appBase="intranet"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false" >
</Host>
</Engine>
</Service>

<Service name="CatalinaThird">
<Connector port="8082" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
<Connector port="8009"
enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
<Engine name="CatalinaThird" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Host name="localhost" appBase="default"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false" >
</Host>
</Engine>
</Service>


</Server>



pl. help.

Thanks

Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8705
    
    6

Please do not post the same question more than once.
CarefullyChooseOneForum


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Different log files for different services in tomcat
 
Similar Threads
Tomcat manager not opening
number of users that can access site parally
Different log files for different services in tomcat
Subdomains?
Tomcat SSL problem