README.md in timber-2.1.5 vs README.md in timber-2.1.6
- old
+ new
@@ -2,23 +2,21 @@
[![ISC License](https://img.shields.io/badge/license-ISC-ff69b4.svg)](LICENSE.md)
[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/github/timberio/timber-ruby)
[![Build Status](https://travis-ci.org/timberio/timber-ruby.svg?branch=master)](https://travis-ci.org/timberio/timber-ruby)
-[Timber.io](https://timber.io) is a simple cloud-based logging platform built for developers.
-This is our official Ruby library.
+[Timber](https://timber.io) is a cloud-based logging system that integrates directly with your
+Ruby app to capture context and metadata without parsing. This produces rich, clean, readable logs
+that are easier to search and use:
-## Overview
+1. [**Installation** - One command: `bundle exec timber install`](#installation)
+2. [**Usage** - Simple yet powerful API](#usage)
+3. [**Integrations** - Automatic context and metadata for your existing logs](#integrations)
+4. [**The Timber Console** - Designed for Ruby developers](#the-timber-console)
+5. [**Get things done with your logs 💪**](#get-things-done-with-your-logs)
-Ruby logs are broken. They're noisy, unparesable, and in the context of multiple servers and processes, unreadable. Current logging systems built for ops engineers haven't helped. This is why we built Timber. It's a different approach to Ruby logging. Instead of prefixing your logs with noisy tags, Timber integrates directly with your application, capturing rich context and metadata without altering your logs. This makes your logs easy to [search, use, and _read_](#do-amazing-things-with-your-logs), giving you _complete_ insight into your Ruby app.
-1. [**Easy setup** - `bundle exec timber install`](#installation)
-2. [**Powerful logging**](#usage)
-3. [**Seamlessly integrates with popular libraries and frameworks**](#integrations)
-4. [**Do amazing things with your Ruby logs**](#do-amazing-things-with-your-logs)
-
-
## Installation
1. In your `Gemfile`, add the `timber` gem:
```ruby
@@ -89,11 +87,11 @@
have to maually set these contexts except in special circumstances.
### How to use it
```ruby
-logger.with_context(job: {id: 123}) do
+Timber.with_context(job: {id: 123}) do
logger.info("Background job execution started")
# ... code here
logger.info("Background job execution completed")
end
```
@@ -118,11 +116,11 @@
### How to use it
Below is a contrived example of timing a background job:
```ruby
-timer = Timber::Timer.start
+timer = Timber.start_timer
# ... code to time ...
logger.info("Processed background job", background_job: {time_ms: timer})
```
And of course, `time_ms` can also take a `Float` or `Fixnum`:
@@ -160,12 +158,11 @@
### How to use it
```ruby
# config/initializers/timber.rb
-config = Timber::Config.instance
-config.logrageify!()
+Timber.config.logrageify!()
```
### How it works
It turns this:
@@ -190,29 +187,27 @@
Internally this is equivalent to:
```ruby
# config/initializers/timber.rb
-config = Timber::Config.instance
-config.integrations.action_controller.silence = true
-config.integrations.action_view.silence = true
-config.integrations.active_record.silence = true
-config.integrations.rack.http_events.collapse_into_single_event = true
+Timber.config.integrations.action_controller.silence = true
+Timber.config.integrations.action_view.silence = true
+Timber.config.integrations.active_record.silence = true
+Timber.config.integrations.rack.http_events.collapse_into_single_event = true
```
### Pro-tip: Keep controller call logs (recommended)
Feel free to deviate and customize which logs you silence. We recommend a slight deviation
from lograge with the following settings:
```ruby
# config/initializers/timber.rb
-config = Timber::Config.instance
-config.integrations.action_view.silence = true
-config.integrations.active_record.silence = true
-config.integrations.rack.http_events.collapse_into_single_event = true
+Timber.config.integrations.action_view.silence = true
+Timber.config.integrations.active_record.silence = true
+Timber.config.integrations.rack.http_events.collapse_into_single_event = true
```
This does _not_ silence the controller call log event. This is because Timber captures the
parameters passed to the controller, which are generally valuable when debugging.
@@ -233,12 +228,11 @@
The following will silence all `[GET] /_health` requests:
```ruby
# config/initializers/timber.rb
-config = Timber::Config.instance
-config.integrations.rack.http_events.silence_request = lambda do |rack_env, rack_request|
+Timber.config.integrations.rack.http_events.silence_request = lambda do |rack_env, rack_request|
rack_request.path == "/_health"
end
```
We require a block because it gives you complete control over how you want to silence requests.
@@ -262,12 +256,11 @@
you can do so like:
```ruby
# config/initializers/timber.rb
-config = Timber::Config.instance
-config.integrations.rack.user_context.custom_user_hash = lambda do |rack_env|
+Timber.config.integrations.rack.user_context.custom_user_hash = lambda do |rack_env|
user = rack_env['warden'].user
if user
{
id: user.id, # unique identifier for the user, can be an integer or string,
name: user.name, # identifiable name for the user,
@@ -322,12 +315,12 @@
6. [**Omniauth**](https://timber.io/docs/languages/ruby/integrations/omniauth)
7. [**Warden**](https://timber.io/docs/languages/ruby/integrations/devise)
8. ...more coming soon! Make a request by [opening an issue](https://github.com/timberio/timber-ruby/issues/new)
-## Do amazing things with your logs
+## Get things done with your logs
-Unlock the potential of your logs:
+Logging features every developer needs:
1. [**Powerful searching.** - Find what you need faster.](https://timber.io/docs/app/console/searching)
2. [**Live tail users.** - Easily solve customer issues.](https://timber.io/docs/app/console/tail-a-user)
3. [**Viw logs per HTTP request.** - See the full story without the noise.](https://timber.io/docs/app/console/trace-http-requests)
4. [**Inspect HTTP request parameters.** - Quickly reproduce issues.](https://timber.io/docs/app/console/inspect-http-requests)