Giter Club home page Giter Club logo

logtail-ruby's Introduction

Logtail Ruby

Collect logs directly from Ruby on Rails, Sinatra, and plain Ruby projects. Supported language versions: Ruby 2.7.0 or newer

You can learn more about using Logtail in Ruby projects in our official docs.

Installation and setup

You can install Logtail to your Ruby projects using the Ruby Bundler.

Ruby Bundler

If you have Ruby bundler already installed you can skip this step. Run the following command to install the ruby bundler:

sudo apt install ruby-bundler

Ruby

To install Logtail to your Ruby project, run the following command:

bundle add logtail

This will install Logtail gem and create Gemfile and Gemfile.lock that are used to track the code dependencies.

Alternatively, add gem "logtail" to your Gemfile manually and then run bundle install.

Example project

To help you get started and integrate Logtail in your Ruby projects, we have prepared an example Ruby project.

How to run the example project

First, download or clone the repository into the select directory. Make sure you are in the projects directory and run the following command:

bundle install

This will install all dependencies listed in the Gemfile.lock file.

Then run the example project by executing the following command:

ruby main.rb <source-token>

Don’t forget to replace the with your actual source token.

You should see the following output:

Output:
All done! You can check your logs now.

This will create a total of 5 different logs, each corresponding to a different log level. You can review these logs in Logtail.

logtail-ruby's People

Contributors

elliahu avatar

Watchers

 avatar

Forkers

jendatovarys

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.