集中式Java日志记录

集中式Java日志记录

本文介绍了集中式Java日志记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种集中分布式软件(用Java编写)的日志记录问题的方法,这很容易,因为有问题的系统只有一台服务器。但请记住,特定服务器的更多实例很可能在未来运行(并且需要更多应用程序),必须有类似Logging-Server的东西,负责传入日志并使其可供访问团队访问。

I'm looking for a way to centralise the logging concerns of distributed software (written in Java) which would be quite easy, since the system in question has only one server. But keeping in mind, that it is very likely that more instances of the particular server will run in the future (and there are going to be more application's in need for this), there would have to be something like a Logging-Server, which takes care of incoming logs and makes them accessable for the support-team.

现在的情况是,有几个java应用程序使用log4j将其数据写入本地文件,因此如果客户端遇到问题,支持团队会遇到问题要求记录日志,这并不总是很容易,需要花费很多时间。在服务器故障的情况下,诊断问题并不大,因为无论如何都存在远程访问,但即使通过Logging-Server监控所有内容仍然很有意义。

当我查看有关集中记录的问题时,我发现另一个(实际上是唯一一个具有(在这种情况下)可用答案的问题。问题是,所有应用程序都在一个封闭的环境中运行(在一个网络内),安全指南也是如此不允许任何有关内部软件的内容离开环境网络。

While I went through the questions regarding "centralised logging" I found another Question (actually the only one with a (in this case) useable answer. Problem being, all applications are running in a closed environment (within one network) and security-guidelines do not permit for anything concerning internal software to go out of the environments network.

我还发现了一篇关于如何这样的Logging-Server。由于这篇文章写于2001年,我原以为有人可能已经解决了这个特殊的问题但是,m搜索结果没有任何结果。

I also found a wonderful article about how one would implement such a Logging-Server. Since the article was written in 2001, I would have thought that someone might have already solved this particular problem. But my search-results came up with nothing.

我的问题:是否存在一个日志框架,用于处理使用集中式服务器登录网络的日志框架可以由支持团队访问吗?

My Question: Is there a logging-framework which handle's logging over networks with a centralised server which can be accessed by the support-team?

规格:


  • 可用性

  • 服务器必须由我们运行。

  • Java 1.5兼容性

  • 与异构网络的兼容性。

  • 最佳案例:协议使用HTTP发送日志(以避免防火墙问题)

  • 最佳案例:使用log4j或LogBack或基本上任何东西实现slf4j

  • Availability
  • Server has to be run by us.
  • Java 1.5 compatibility
  • Compatibility to a heterogeneous network.
  • Best-Case: Protocol uses HTTP to send logs (to avoid firewall-issues)
  • Best-Case: Uses log4j or LogBack or basically anything that implements slf4j

没必要,但很高兴


  • 身份验证和安全性当然是一个问题,但可以至少暂停一段时间(如果它是开放式软件,我们会将其扩展到我们的需求 OT:我们总是回馈项目)。

  • 数据挖掘和分析对于使软件更好有帮助,这可能也是一个外部应用程序。

我最糟糕的情况是他们不是那样的软件。对于这种情况,我们可能会自己实现。但是,如果有这样的客户端 - 服务器应用程序,我非常感谢不需要做这个特别有问题的工作。

My worst-case scenario is that their is no software like that. For that case, we would probably implement this ourselves. But if there is such a Client-Server Application I would very much appreciate not needing to do this particularly problematic bit of work.

提前致谢

更新:该解决方案必须在几个支持java的平台上运行。 (主要是Windows,Linux,一些HP Unix)

Update: The solution has to run on several java-enabled platforms. (Mostly Windows, Linux, some HP Unix)

更新:经过更多的研究,我们实际上找到了一个我们能够获得的解决方案。 (至少自2015年中起离线)为分布式软件提供日志服务,并与log4j兼容和logback(与slf4j兼容)。它允许我们通过应用程序分析每个用户的方式。因此,很容易重现报告的错误(甚至是未报告的错误)。它还通过电子邮件通知我们重要事件,并且报告系统将相同来源的日志汇总为易于访问的格式。他们在几天前部署(这是完美无瑕的)并且运行良好。

Update: After a lot more research we actually found a solution we were able to acquire. clusterlog.net (offline since at least mid-2015) provides logging services for distributed software and is compatible to log4j and logback (which is compatible to slf4j). It lets us analyze every single users way through the application. Thus making it very easy to reproduce reported bugs (or even non reported ones). It also notifies us of important events by email and has a report system were logs of the same origin are summorized into an easily accessable format. They deployed (which was flawless) it here just a couple of days ago and it is running great.

更新(2016):这个问题仍然有很多流量,但我提到的网站不再存在。

Update (2016): this question still gets a lot of traffic, but the site I referred to does not exist anymore.

推荐答案

您可以将Log4j与SocketAppender一起使用,因此您必须编写服务器部分作为LogEvent处理。
请参阅

You can use Log4j with the SocketAppender, thus you have to write the server part as LogEvent processing.see http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/net/SocketAppender.html

这篇关于集中式Java日志记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 08:07