Skip to content

Commit 909e7a2

Browse files
authored
Update README.md: simplification (#15)
1 parent eb93327 commit 909e7a2

File tree

2 files changed

+50
-99
lines changed

2 files changed

+50
-99
lines changed

README.md

Lines changed: 10 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,22 @@
1-
# 🪵 Logtail Integration For Rack
1+
# [Better Stack](https://betterstack.com/logs) Rack client
22

3-
[![Logtail ruby dashboard](https://user-images.githubusercontent.com/19272921/154085622-59997d5a-3f91-4bc9-a815-3b8ead16d28d.jpeg)](https://betterstack.com/logtail)
3+
📣 Logtail is now part of Better Stack. [Learn more ⇗](https://betterstack.com/press/introducing-better-stack/)
4+
5+
[![Better Stack dashboard](https://github.com/logtail/logtail-python/assets/10132717/e2a1196b-7924-4abc-9b85-055e17b5d499)](https://betterstack.com/logs)
46

57
[![ISC License](https://img.shields.io/badge/license-ISC-ff69b4.svg)](LICENSE.md)
68
[![Gem Version](https://badge.fury.io/rb/logtail-rack.svg)](https://badge.fury.io/rb/logtail-rack)
79
[![Build Status](https://github.com/logtail/logtail-ruby-rack/actions/workflows/main.yml/badge.svg)](https://github.com/logtail/logtail-ruby-rack/actions/workflows/main.yml)
810

9-
This library integrates the [`logtail` Ruby library](https://github.com/logtail/logtail-ruby) with the [rack](https://github.com/rack/rack) framework,
10-
turning your Rack logs into rich structured events.
11-
12-
* **Sign-up: [https://logs.betterstack.com](https://logs.betterstack.com)**
13-
14-
Collect logs directly from your Ruby Rack projects. To start logging Ruby projects explore the [Logtail Ruby library](https://github.com/logtail/logtail-ruby).
15-
16-
[Better Stack](https://logs.betterstack.com) is a hosted service that centralizes all of your logs into one place.
17-
Allowing for analysis, correlation and filtering with SQL.
18-
Actionable Grafana dashboards and collaboration come built-in.
19-
Logtail works with [any language or platform and any data source](https://betterstack.com/docs/logs/).
20-
21-
### Features
22-
- Simple integration.
23-
- Support for structured logging and events.
24-
- Automatically captures useful context.
25-
- Performant, light weight, with a thoughtful design.
26-
27-
### Supported language versions
28-
- Ruby 2.3 or newer
29-
- Rack 1.2 or newer
30-
31-
# Installation
32-
Install the Logtail Rack client library, run the following command:
33-
34-
```bash
35-
bundle add logtail-rack
36-
```
11+
Experience SQL-compatible structured log management based on ClickHouse. [Learn more ⇗](https://betterstack.com/logs)
3712

38-
Alternatively, add `gem "logtail-rack"` to your `Gemfile` manually and then run `bundle install`.
13+
## Documentation
3914

40-
Then add following configuration into your `config.ru`:
15+
[Getting started ⇗](https://betterstack.com/docs/logs/ruby-and-rails/#logging-from-rack)
4116

42-
```ruby
43-
# Initialization of logging middlewares (you don't have to use all)
44-
use Logtail::Integrations::Rack::HTTPContext
45-
use Logtail::Integrations::Rack::HTTPEvents
46-
use Logtail::Integrations::Rack::ErrorEvent
47-
use Logtail::Integrations::Rack::UserContext
48-
use Logtail::Integrations::Rack::SessionContext
49-
50-
http_io_device = Logtail::LogDevices::HTTP.new("<SOURCE_TOKEN>")
51-
logger = Logtail::Logger.new(http_io_device)
52-
Logtail::Config.instance.logger = logger
53-
54-
# Here is your application initialization
55-
run ...
56-
```
57-
58-
*Don't forget to replace `<SOURCE_TOKEN>` with your actual source token which you can find by going to [Better Stack Logs](https://logs.betterstack.com/dashboard) -> Source -> Edit.*
17+
## Need help?
18+
Please let us know at [[email protected]](mailto:[email protected]). We're happy to help!
5919

6020
---
6121

62-
# Example project
63-
64-
To help you get started with using Better Stack in your Rails projects, we have prepared a simple program that showcases the usage of Logtail logger.
65-
66-
## Download and install the example project
67-
68-
You can download the [example project](https://github.com/logtail/logtail-ruby-rack/tree/main/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:
69-
70-
```bash
71-
bundle install
72-
```
73-
74-
This will install all dependencies listed in the `Gemfile.lock` file.
75-
76-
Then replace `<SOURCE_TOKEN>` in `config.ru` with your actual source token which you can find by going to [Better Stack Logs](https://logs.betterstack.com/dashboard) -> Source -> Edit.
77-
78-
```ruby
79-
http_io_device = Logtail::LogDevices::HTTP.new("<YOUR_ACTUAL_SOURCE_TOKEN>")
80-
```
81-
82-
## Run the example project
83-
84-
To run the example application, run the following command:
85-
86-
```bash
87-
rackup
88-
```
89-
90-
This will start a local server and you visit [http://127.0.0.1:9292](http://127.0.0.1:9292) in your browser.
91-
92-
You should see the following output:
93-
94-
```bash
95-
All done!
96-
Log into your Logtail account to check your logs.
97-
```
98-
99-
This will create a total of 4 different logs. You can review these logs in Better Stack.
100-
101-
You can visit any path on the server to see the request path being logged in context. Visit [/error](http://127.0.0.1:9292) to see an example exception being logged.
102-
103-
## Explore how example project works
104-
105-
Learn how to setup Ruby logging by exploring the workings of the [example project](https://github.com/logtail/logtail-ruby-rack/tree/main/example-project) in detail.
106-
107-
---
108-
109-
## Get in touch
110-
111-
Have any questions? Please explore the Better Stack [documentation](https://betterstack.com/docs/logs/) or contact our [support](https://betterstack.com/help).
22+
[ISC license](https://github.com/logtail/logtail-ruby-rack/blob/main/LICENSE.md), [example project](https://github.com/logtail/logtail-ruby-rack/tree/main/example-project)

example-project/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Example project
2+
3+
To help you get started with using Better Stack in your Rack projects, we have prepared a simple program that showcases the usage of Logtail logger.
4+
5+
## Download and install the example project
6+
7+
You can download the [example project](https://github.com/logtail/logtail-ruby-rack/tree/main/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:
8+
9+
```bash
10+
bundle install
11+
```
12+
13+
This will install all dependencies listed in the `Gemfile.lock` file.
14+
15+
Then replace `<SOURCE_TOKEN>` in `config.ru` with your actual source token which you can find by going to [Better Stack Logs](https://logs.betterstack.com/dashboard) -> Source -> Edit.
16+
17+
```ruby
18+
http_io_device = Logtail::LogDevices::HTTP.new("<YOUR_ACTUAL_SOURCE_TOKEN>")
19+
```
20+
21+
## Run the example project
22+
23+
To run the example application, run the following command:
24+
25+
```bash
26+
rackup
27+
```
28+
29+
This will start a local server and you visit [http://127.0.0.1:9292](http://127.0.0.1:9292) in your browser.
30+
31+
You should see the following output:
32+
33+
```bash
34+
All done!
35+
Log into your Logtail account to check your logs.
36+
```
37+
38+
This will create a total of 4 different logs. You can review these logs in Better Stack.
39+
40+
You can visit any path on the server to see the request path being logged in context. Visit [/error](http://127.0.0.1:9292) to see an example exception being logged.

0 commit comments

Comments
 (0)