Rails LOG to JSON files

387 views
Skip to first unread message

Harisankar P S

unread,
Sep 4, 2013, 11:20:31 AM9/4/13
to kerala-ruby...@googlegroups.com
Guys, 

How can we make the rails application store its log as JSON files rather than regular files. I wish to later wish to process these JSON data using logstash ( http://logstash.com ) or some custom ruby scripts.

regards,

--
Harisankar P S
http://tech.hsps.in

Sooraj Balakrishnan

unread,
Sep 4, 2013, 12:27:07 PM9/4/13
to kerala-ruby...@googlegroups.com
Harishankar,

I think this might help you: https://github.com/dwbutler/logstash-logger

Also, try installing Kibana with Logstash. Its awesome.

Sooraj

-- Sooraj


--
You received this message because you are subscribed to the Google Groups "Kerala Ruby Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kerala-ruby-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Harisankar P S

unread,
Sep 6, 2013, 7:02:53 AM9/6/13
to kerala-ruby...@googlegroups.com
On Wed, Sep 4, 2013 at 9:57 PM, Sooraj Balakrishnan <
kasarag...@gmail.com
>
wrote:
Harishankar,

I think this might help you: https://github.com/dwbutler/logstash-logger

Also, try installing Kibana with Logstash. Its awesome.



Thanks for the info on the gem, and true kibana with logstash is awesome I saw a small demo of the system the other day. Even though my present plan is to try logstash, I am also interested to store it as a local JSON file as well, since doing it will give me more options as a programmer. 

Can you suggest how I can make my rails application store the local logs as json files also. In the gem you mentioned above, it seems like its sending the logs to the TCP socket of the logstash server. 


Sooraj Balakrishnan

unread,
Sep 6, 2013, 7:43:57 AM9/6/13
to kerala-ruby...@googlegroups.com
I used Logstash/Kibana for quite a few months to parse web server logs.
I haven't tried writing JSON logs from a rails application. But i would suggest you to write some other script which will parse rails development/production.log and sent it to logstash.  Logstash has very cool input filters. :)

-- Sooraj


Reply all
Reply to author
Forward
0 new messages