Skip to content

Example architecture using LogDNA, Lograge and Ruby on Rails to build a secret message app.

License

Notifications You must be signed in to change notification settings

logdna/logdna_lograge_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Example architecture using LogDNA, Lograge and Ruby on Rails to build a secret message app.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published