logtail 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -59
- data/lib/logtail/config.rb +1 -1
- data/lib/logtail/log_entry.rb +2 -2
- data/lib/logtail/version.rb +1 -1
- metadata +2 -3
- data/CHANGELOG.md +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10c467039aa517fd668eb0b4f25a3bc0405331b9c422984b01e7effa7bfd1ceb
|
4
|
+
data.tar.gz: 2890f2588f6beb9671037e0521a3eb361e80937e0c475b4be2f2895e48422540
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81d0c6479082f302ff146cb321f9483c6b46a8d2fbf9133e1c661bc9694f5d8134447a2ec6d8ab7bfbc6ee36abc66fabe0777e113b199dc31642810fbfee7322
|
7
|
+
data.tar.gz: 161f16cd44e8522fe9c6e47b31773a2d422372ac082409d3afaec74ba249807af1a51512fcb1c151eb5541ad45cbbfc82d62eccde03231b25129abe0dfda232e
|
data/README.md
CHANGED
@@ -1,69 +1,22 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
[![Logtail ruby dashboard](https://user-images.githubusercontent.com/19272921/154085622-59997d5a-3f91-4bc9-a815-3b8ead16d28d.jpeg)](https://betterstack.com/logtail)
|
1
|
+
# [Better Stack](https://betterstack.com/logs) Ruby client
|
4
2
|
|
5
|
-
[
|
6
|
-
[![Gem Version](https://badge.fury.io/rb/logtail-ruby.svg)](https://badge.fury.io/rb/logtail-ruby)
|
7
|
-
[![Build Status](https://github.com/logtail/logtail-ruby/workflows/build/badge.svg)](https://github.com/logtail/logtail-ruby/actions?query=workflow%3Abuild)
|
8
|
-
|
9
|
-
Collect logs directly from your Ruby projects. To start logging Ruby on Rails projects explore the [Logtail Rails library](https://github.com/logtail/logtail-ruby-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.
|
3
|
+
📣 Logtail is now part of Better Stack. [Learn more ⇗](https://betterstack.com/press/introducing-better-stack/)
|
30
4
|
|
31
|
-
|
5
|
+
[![Better Stack dashboard](https://github.com/logtail/logtail-python/assets/10132717/e2a1196b-7924-4abc-9b85-055e17b5d499)](https://betterstack.com/logs)
|
32
6
|
|
33
|
-
|
34
|
-
|
35
|
-
|
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-ruby/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:
|
42
|
-
|
43
|
-
```bash
|
44
|
-
bundle install
|
45
|
-
```
|
46
|
-
|
47
|
-
This will install all dependencies listed in the `Gemfile.lock` file.
|
7
|
+
[![ISC License](https://img.shields.io/badge/license-ISC-ff69b4.svg)](LICENSE.md)
|
8
|
+
[![Gem Version](https://badge.fury.io/rb/logtail.svg)](https://badge.fury.io/rb/logtail)
|
9
|
+
[![Build Status](https://github.com/logtail/logtail-ruby/workflows/build/badge.svg)](https://github.com/logtail/logtail-ruby/actions?query=workflow%3Abuild)
|
48
10
|
|
49
|
-
|
50
|
-
|
51
|
-
To run the example application, run the following command:
|
11
|
+
Experience SQL-compatible structured log management based on ClickHouse. [Learn more ⇗](https://betterstack.com/logs)
|
52
12
|
|
53
|
-
|
54
|
-
bundle exec ruby main.rb <source-token>
|
55
|
-
```
|
13
|
+
## Documentation
|
56
14
|
|
57
|
-
|
15
|
+
[Getting started ⇗](https://betterstack.com/docs/logs/ruby-and-rails/#logging-from-ruby)
|
58
16
|
|
59
|
-
|
17
|
+
## Need help?
|
18
|
+
Please let us know at [hello@betterstack.com](mailto:hello@betterstack.com). We're happy to help!
|
60
19
|
|
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-ruby/tree/main/example-project) in detail.
|
64
|
-
|
65
20
|
---
|
66
|
-
|
67
|
-
## Get in touch
|
68
21
|
|
69
|
-
|
22
|
+
[ISC license](https://github.com/logtail/logtail-ruby/blob/main/LICENSE.md), [example project](https://github.com/logtail/logtail-ruby/tree/main/example-project)
|
data/lib/logtail/config.rb
CHANGED
@@ -46,7 +46,7 @@ module Logtail
|
|
46
46
|
# See {Logtail::LogEntry} for available attributes of the block parameter.
|
47
47
|
#
|
48
48
|
# @example Rails
|
49
|
-
# config.logtail.filter_sent_to_better_stack { |log_entry| log_entry.context_snapshot[:http][:path].start_with?('_') }
|
49
|
+
# config.logtail.filter_sent_to_better_stack { |log_entry| log_entry.context_snapshot[:http][:path].start_with?('/_') }
|
50
50
|
# @example Everything else
|
51
51
|
# Logtail.config.filter_sent_to_better_stack { |log_entry| log_entry.message.include?('IGNORE') }
|
52
52
|
def filter_sent_to_better_stack(&block)
|
data/lib/logtail/log_entry.rb
CHANGED
@@ -134,13 +134,13 @@ module Logtail
|
|
134
134
|
end
|
135
135
|
|
136
136
|
def logtail_logger_frame?(frame)
|
137
|
-
!frame.
|
137
|
+
!frame.path.nil? && frame.path.end_with?(LOGGER_FILE)
|
138
138
|
end
|
139
139
|
|
140
140
|
def path_relative_to_app_root(frame)
|
141
141
|
Pathname.new(frame.absolute_path).relative_path_from(root_path).to_s
|
142
142
|
rescue
|
143
|
-
frame.absolute_path
|
143
|
+
frame.absolute_path || frame.path
|
144
144
|
end
|
145
145
|
|
146
146
|
def root_path
|
data/lib/logtail/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logtail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Better Stack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|
@@ -146,7 +146,6 @@ files:
|
|
146
146
|
- ".github/workflows/main.yml"
|
147
147
|
- ".gitignore"
|
148
148
|
- ".rspec"
|
149
|
-
- CHANGELOG.md
|
150
149
|
- Gemfile
|
151
150
|
- LICENSE.md
|
152
151
|
- README.md
|
data/CHANGELOG.md
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
# Changelog
|
2
|
-
|
3
|
-
All notable changes to this project will be documented in this file.
|
4
|
-
|
5
|
-
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
6
|
-
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
7
|
-
|
8
|
-
## [Unreleased]
|
9
|
-
|
10
|
-
## [0.1.0] - 2021-02-11
|
11
|
-
|
12
|
-
- The first version of the client.
|
13
|
-
|
14
|
-
## [0.1.2] - 2021-04-22
|
15
|
-
|
16
|
-
- Fixed string encoding.
|
17
|
-
|
18
|
-
## [0.1.3] - 2021-06-11
|
19
|
-
|
20
|
-
- Fixed detection of the frame that calls the logger.
|
21
|
-
|
22
|
-
## [0.1.7] - 2021-08-16
|
23
|
-
|
24
|
-
- Fixed runtime context's frame label encoding.
|
25
|
-
|
26
|
-
## [0.1.8] - 2023-01-16
|
27
|
-
|
28
|
-
- Fix issue where message is lost when logging hashes with multiple IO devices (thanks @olivier-thatch!)
|