|
1 | | -# 🪵 Logtail - Ruby Logging For Everyone |
| 1 | +# Logtail - Ruby Logging Made Easy |
| 2 | + |
| 3 | + [](https://betterstack.com/logtail) |
2 | 4 |
|
3 | 5 | [](LICENSE.md) |
| 6 | +[](https://badge.fury.io/rb/logtail-ruby) |
4 | 7 | [](https://github.com/logtail/logtail-ruby/actions?query=workflow%3Abuild) |
| 8 | + |
| 9 | +Collect logs directly from your Ruby projects. For Rails |
| 10 | + |
| 11 | +[Logtail](https://betterstack.com/logtail) is a hosted service that centralizes all of your logs into one place. Allowing for analysis, correlation and filtering with SQL. Actionable Grafana dashboards and collaboration come built-in. Logtail works with [any language or platform and any data source](https://docs.logtail.com/). |
| 12 | + |
| 13 | +### Features |
| 14 | +- Simple integration. |
| 15 | +- Support for structured logging and events. |
| 16 | +- Automatically captures useful context. |
| 17 | +- Performant, light weight, with a thoughtful design. |
| 18 | + |
| 19 | +### Supported language versions |
| 20 | +- Ruby 2.7.0 or newer |
| 21 | + |
| 22 | +# Installation |
| 23 | +Install the Logtail Ruby client library, run the following command: |
| 24 | + |
| 25 | +```bash |
| 26 | +bundle add logtail |
| 27 | +``` |
| 28 | + |
| 29 | +This will install Logtail gem and create `Gemfile` and `Gemfile.lock` that are used to track the code dependencies. |
| 30 | + |
| 31 | +Alternatively, add `gem "logtail"` to your `Gemfile` manually and then run `bundle install`. |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +# Example project |
| 36 | + |
| 37 | +To help you get started with using Logtail in your Ruby projects, we have prepared a simple program that showcases the usage of Logtail logger. |
| 38 | + |
| 39 | +## Download and install the example project |
| 40 | + |
| 41 | +You can download the [example project](https://github.com/logtail/logtail-python/tree/master/example-project) from GitHub directly or you can clone it to a select directory. Make sure you are in the projects directory and run the following command: |
| 42 | + |
| 43 | +```bash |
| 44 | +bundle install |
| 45 | +``` |
| 46 | + |
| 47 | +This will install all dependencies listed in the `Gemfile.lock` file. |
| 48 | + |
| 49 | + ## Run the example project |
| 50 | + |
| 51 | + To run the example application, run the following command: |
| 52 | + |
| 53 | +```bash |
| 54 | +ruby main.rb <source-token> |
| 55 | +``` |
| 56 | + |
| 57 | +*Don't forget to replace `<source-token>` with your actual source token which you can find by going to logtail.com -> sources -> edit.* |
| 58 | + |
| 59 | +This will create a total of 5 different logs, each corresponding to a different log level. You can review these logs in Logtail. |
| 60 | + |
| 61 | +## Explore how example project works |
| 62 | + |
| 63 | +Learn how to setup Ruby logging by exploring the workings of the [example project](https://github.com/logtail/logtail-python/tree/master/example-project) in detail. |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +## Get in touch |
| 68 | + |
| 69 | +Have any questions? Please explore the Logtail [documentation](https://docs.logtail.com/) or contact our [support](https://betterstack.com/help). |
0 commit comments