Skip to content

Latest commit

 

History

History
59 lines (42 loc) · 2.39 KB

README.md

File metadata and controls

59 lines (42 loc) · 2.39 KB

Ruby on Rails, Lograge and LogDNA

Welcome, welcome.

First off, thanks for visitng! In this repo you will find instructions on how to tool Rails using the Lograge gem with LogDNA via a simple cryptographic app that deciphers a secret message using a key logged to LogDNA.

TL;DR;

Been here done that and just wanna see the LogDNA / Lograge specifics?

  1. Add LogDNA and Lograge gems to your Gemfile.
gem "logdna"
gem "lograge"
  1. Enable Lograge via an initializer
Rails.application.configure do
  config.lograge.enabled = true
  config.lograge.formatter = Lograge::Formatters::Json.new
end
  1. Specify LogDNA as your logger in the environment configs and set the API key.
config.logger = Logdna::Ruby.new(
    LOGDNA_API_KEY, {
        :app => "rails-lograge-decipher"
    }
)

Pro tip: send data via JSON with a "message" for easy scanning in LogDNA's Log Viewer. See the log's message definition here.

Q.E.D.

Guide

You can check out the detailed guide here.

In the end, the gist is to (assuming you got a Rails app already tooled with LogRage handy):

  1. Steep tea
  2. Connect to LogDNA using your accounts API key.
  3. Configure Lograge to utilize LogDNA.
  4. Restart Rails.
  5. Sit back. Witness logs in LogDNA.
  6. Enjoy tea.

Blog

We wrote a short blog on this that you can read here.

Contributing

Bug reports and pull requests are welcome on GitHub at logdna/logdna_lograge_example. Be sure to first check out our contributing doc.

License

We use a standard MIT license on this repo.