Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Different log files for different services in tomcat

 
naveen jain
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do not post the same question more than once.
CarefullyChooseOneForum
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic