I am using Tomcat version 5.5 and have two questions.
I am starting tomcat through Embedded Tomcat.Like for example :
Embedded tomcatServer = new Embedded();
//engine
//host
//context
//connector
tomcatServer.start();
Question 1 :(related to logging)
Tomcat starts successfully and application is working fine but “Tomcat” logs(much concern of tomcat logs rather then application specific logs) are not getting generated in tomcat log directory.
For double check when i starts tomcat manually through startup.sh then tomcat logs are getting generated in log folder of tomat.
I have also searched that prior to version 5 there was one method setLogger/setDebug in org.apache.catalina.startup.Embedded Class.But in version 5.5 its not available…plz help how to configure in order to enable logs thorugh Embedded Tomcat.
Question 2 :(related to session replication)
As thorugh Embedded Tomcat server.xml does not works(not used by tomcat) so need help in writting java code for <Cluster> element (as this is the main element for session replication).
I am able to replicate the session when i start tomcat manually or through startup.sh which uses server.xml but now i want to do the same session replication through Embedded Tomcat Class.Please Help..
Thanks in Advance.
Vikas
Re #1: Set up
java.util.loggingproperly (see the docs).Re #2: Download the source code for Tomcat and search for
server.xml. There is probably some class which reads it. There, you can also find the code which configures clustering.