更新WebSphere集群中的日志级别
我们在 WAS6.1 上使用 JDK 记录器,并有一个网页(JSP)来更新给定包的日志级别。 请求被发送到 Servlet,Servlet 获取包的当前记录器集并更新每个记录器的新级别。
但是 war/ear 将部署在集群中,现在的问题是,我如何确保所有节点中的日志级别都更新,而不仅仅是请求发送到的节点?
仅供参考,我们的应用程序中有 Spring、JDK 日志记录、JEE1.4
We use JDK logger on WAS6.1 and have a web page(JSP) to update the log level for a given package.
The request is sent to Servlet which gets the current set of loggers for the package and updates the new level to each of them.
But the war/ear is going to be deployed in cluster and now the question is, how do i ensure that the log levels are updated in all the nodes and not just the node to which the request was sent?
FYI, we have Spring, JDK logging, JEE1.4 in our application
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 JMX 来做到这一点。每个 WebSphere 实例公开一个 TraceService 允许设置日志级别。该 MBean 使用 WebSphere 特定约定,但最终它会更新 JDK 记录器 (java.util.logging) 的日志级别。
您可以直接连接到每个集群成员,也可以连接到部署管理器并从那里查找相关的 TraceService MBean(部署管理器的 MBean 服务器实际上提供了一个联合视图,其中包括在集群中的所有服务器中注册的所有 MBean)。细胞)。
You could do that using JMX. Each WebSphere instance exposes an MBean of type TraceService that allows to set the log levels. That MBean uses WebSphere specific conventions, but in the end it updates the log levels of the JDK loggers (java.util.logging).
You can either connect to each cluster member directly, or you can connect to the deployment manager and look up the relevant TraceService MBeans from there (the MBean server of the deployment manager actually provides a federated view that includes all MBeans registered in all servers in the cell).