需要嵌入式 Tomcat 的帮助(日志记录 + 会话复制) [英] Need Help on Embedded Tomcat ( logging + session replication)

查看:44
本文介绍了需要嵌入式 Tomcat 的帮助(日志记录 + 会话复制)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Tomcat 5.5 版,有两个问题.我正在通过嵌入式 Tomcat 启动 tomcat.例如:

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();

问题 1 :(与日志相关)

Question 1 :(related to logging)

Tomcat 成功启动并且应用程序工作正常,但是在 tomcat 日志目录中没有生成Tomcat"日志(主要关注 tomcat 日志而不是应用程序特定日志).为了仔细检查当我通过 startup.sh 手动启动 tomcat 时,tomcat 日志会在 tomat 的日志文件夹中生成.我还搜索过,在第 5 版之前,org.apache.catalina.startup.Embedded Class 中有一种方法 setLogger/setDebug.但是在 5.5 版中它不可用...请帮助如何配置以通过嵌入式启用日志雄猫.

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.

问题 2 :(与会话复制有关)

Question 2 :(related to session replication)

由于嵌入式 Tomcat server.xml 不起作用(tomcat 未使用),因此需要帮助为 <Cluster> 元素编写 java 代码(因为这是会话复制的主要元素).当我手动或通过使用 server.xml 的 startup.sh 启动 tomcat 时,我能够复制会话,但现在我想通过嵌入式 Tomcat 类进行相同的会话复制.请帮助..

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

提前致谢.

维卡斯

vikas31jain@gmail.com

vikas31jain@gmail.com

推荐答案

Re #1:正确设置 java.util.logging (查看文档).

Re #1: Set up java.util.logging properly (see the docs).

Re #2:下载 Tomcat 的源代码并搜索 server.xml.可能有一些课程会阅读它.在那里,您还可以找到配置集群的代码.

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.

这篇关于需要嵌入式 Tomcat 的帮助(日志记录 + 会话复制)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆