多个Web应用程序的单个日志文件

编程入门 行业动态 更新时间:2024-10-23 23:19:14
本文介绍了多个Web应用程序的单个日志文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在我的tomcat中,部署了多个Web应用程序,它们彼此通信.当前,它们都有自己的日志文件.但是,当呼叫产生问题时,我必须首先检查与之通话的应用程序,并检查该呼叫中涉及的各个应用程序的日志文件.因此,我希望这样做,因为所有应用程序都部署在同一个tomcat中并共享一个通用的log4j,因此,如果对任何应用程序进行了调用,则所有日志都应放在一个日志文件中,无论我的Web应用程序如何参与,所有错误均来自任何Web应用程序通话期间应保存在单个日志文件中.

In my tomcat there are multiple webapps deployed and they communicate with each other. Currently they all have their own log file. But when there is some issue comes from call I have to 1st check with the app to whom I made a call and check log file of respective apps involved in the call. So I want that, as all apps is deployed in same tomcat and sharing a common log4j, if a call made to any app then all logs should be in a single log file and no matters how my webapps are involved all error comes from any webapp during the call should be in a single log file.

我不知道该如何实现.因此,任何帮助都是有意义的.

I have no idea how can I achieve this. So any help is appreciable.

已 我认为我的问题尚未解决,因此已更新用例:

Edited: I think my question is not cleared so updated with use case:

  • 我有三个Web应用程序A,B,C,它们的日志文件分别为A.log,B.log和C.log.
  • 我打了两个电话.第一个到A(内部称为C),第二个到B(内部称为C).
  • 现在,第一次调用的日志记录必须在A.log中(每个步骤的日志都在webapp c中执行),而第二次调用的日志记录必须在B.log中(每个步骤的日志都在webapp c中执行).
  • 推荐答案

    我建议您保留日志文件不变,并使用单独的日志收集器服务.然后,您可以使用该服务进行搜索.另外,您还可以获得过滤器和其他精美功能.

    I'd rather recommend that you leave your log files as they are and use a separate log collector service. Then you can just search using that service what you want to know. As an additional bonus, you get filters and other nifty features.

    LogStash 是我听说过的好东西.虽然还没有时间使用它,但是我认为这是一个应该去的方向. 首页上有关于它的介绍,入门资料此处.

    LogStash is one I've heard good things about. Haven't had the time to take it into use yet, though, but I think that's the direction one should go to. There's a presentation about it on the front page and getting started material here.

    免责声明:我与他们没有任何关系,我只是认为这是日志分析应遵循的方向.

    Disclaimer: I'm no way affiliated with them, I just think that's the direction log analysis should go to.

    更多推荐

    多个Web应用程序的单个日志文件

    本文发布于:2023-11-11 07:53:01,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1577806.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:多个   应用程序   文件   日志   Web

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!