Centralised Java Logging

前端 未结 4 1198
既然无缘
既然无缘 2020-12-08 07:29

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 serv

4条回答
  •  囚心锁ツ
    2020-12-08 07:44

    There's a ready-to-use solution from Facebook - Scribe - that is using Apache Hadoop under the hood. However, most companies I'm aware of still tend to develop in-house systems for that. I worked in one such company and dealt with logs there about two years ago. We also used Hadoop. In our case we had the following setup:

    • We had a small dedicated cluster of machines for log aggregation.
    • Workers mined logs from production service and then parse individual lines.
    • Then reducers would aggregate the necessary data and prepare reports.

    We had a small and fixed number of reports that we were interested in. In rare cases when we wanted to perform a different kind of analysis we would simply add a specialized reducer code for that and optionally run it against old logs.

    If you can't decide what kind of analyses you are interested in in advance then it'll be better to store structured data prepared by workers in HBase or some other NoSQL database (here, for example, people use Mongo DB). That way you won't need to re-aggregate data from the raw logs and will be able to query the datastore instead.

    There are a number of good articles about such logging aggregation solutions, for example, using Pig to query the aggregated data. Pig lets you query large Hadoop-based datasets with SQL-like queries.

提交回复
热议问题