Is anyone logging the applications logs to MongoDB? Is it possible to run real time analysis/monitoring jobs on the log objects in MongoDB?
-
I am currently looking into an option of writing application logs to MongoDB using log4mongo-java. Is any one logging the applications logs to mongoDB? Is it possible to run real time analysis/monitoring jobs on the log objects in MongoDB?
-
Answer:
I've seen at lot of companies are using MongoDB to store application logs. Its schema-freeness is really flexible for application logs, at which schema tends to change time-to-time. Also, its Capped Collection[1] feature is really useful because it automatically purges old data to keep the data fit into the memory. People aggregates the logs by normal Grouping or MapReduce, but it's not that fast. Especially MongoDB's MapReduce only works within a single thread and its JavaScript execution overhead is huge. New aggregation framework[2] could solve this problem. Another concern is high write through put. Although MongoDB's insert is fire-and-forget style by default, calling a lot of insert command causes a heavy write lock contention. This could affect the application performance, and prevent the readers to aggregate / filter the stored logs. One solution might be using the log collector framework such as [3], Logstash[4], or for batch + asynchronous insertion. Disclaimer: I'm a committer of Fluentd project. [1] http://www.mongodb.org/display/DOCS/Capped+Collections [2] http://docs.mongodb.org/manual/applications/aggregation/ [3] http://docs.fluentd.org/articles/apache-to-mongodb [4] http://logstash.net/docs/1.1.0/outputs/mongodb
Kazuki Ohta at Quora Visit the source
Other answers
We are dumping 100.000 log-document/day to mongodb and also we have a capped collection to view real time logs. Capped collections are great solution for performance for these type of cases.
Hasan Tayyar BeÅik
Yes -- we do it at Optimis with two tools that I wrote: Bunyan: https://github.com/ajsharp/bunyan Papermill: https://github.com/ajsharp/papermill
Alex Sharp
This looks the model that Graylog2 is currently doing : <http://www.graylog2.org/ - not with log4mongo-java, but with gelf4j.
James Casey
Related Q & A:
- Is it possible to run a custom ROM on AVD?Best solution by Stack Overflow
- How can I use real time social data from Datasift and perform real time analytics on it?Best solution by Quora
- Is it possible to run Oracle Forms without applet?Best solution by Stack Overflow
- Why does my nose run EVERY time I eat?Best solution by ChaCha
- Does anyone know any real work at home jobs or online jobs?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.