Skip to content

Commit

Permalink
Cleanup lograge config (#367)
Browse files Browse the repository at this point in the history
* Update SUMMARY.md

* Update SUMMARY.md

* Delete config file

* Update README.md

* Fix link

* Wrap lograge config in conditional
  • Loading branch information
simon-isler authored May 26, 2024
1 parent 7b02653 commit 05b1003
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 25 deletions.
2 changes: 1 addition & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
- [Bootstrap](ruby_on_rails/bootstrap.md)
- [FontAwesome](ruby_on_rails/font_awesome.md)
- [Bullet](ruby_on_rails/bullet.md)
- [Lograge](ruby_on_rails/lograge.md)
- [Lograge](ruby_on_rails/appsignal.md)
- [Hotjar](ruby_on_rails/hotjar.md)
- [Wicked PDF](ruby_on_rails/wicked_pdf.md)
- [Recaptcha v3](ruby_on_rails/recaptcha.md)
Expand Down
2 changes: 1 addition & 1 deletion ruby_on_rails/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ useful services:
1. [bootstrap](bootstrap.md)
1. [font-awesome](font_awesome.md)
1. [bullet](bullet.md) `gem 'bullet'`
1. [lograge](lograge.md) `gem 'lograge'`
1. [lograge](appsignal.md) `gem 'lograge'`
1. Rack Tracker (Google Analytics) `gem 'rack-tracker'` --> see [Google Analytics](../google_analytics.md)
1. [Typescript](https://github.com/typescript-ruby/typescript-rails)
1. Favicons
Expand Down
26 changes: 14 additions & 12 deletions ruby_on_rails/appsignal.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ end

### Lograge

We use [lograge](lograge.md) in many projects. Here is how to configure
We use [lograge](https://github.com/roidrage/lograge) in many projects. Here is how to configure
it with AppSignal to get properly tagged logs.

Using this configuration we get the fully tagged lograge lines and also
Expand All @@ -100,17 +100,19 @@ us to filter by request id with one click and get all relevant log data at once.

```ruby
# config/initializers/lograge.rb
Rails.application.configure do
config.lograge.enabled = true
config.lograge.keep_original_rails_log = true
config.lograge.logger = Appsignal::Logger.new(
"rails",
format: Appsignal::Logger::LOGFMT
)
config.lograge.custom_payload do |controller|
{
request_id: controller.request.request_id
}
if ENV['LOGRAGE_ENABLED'] == 'true'
Rails.application.configure do
config.lograge.enabled = true
config.lograge.keep_original_rails_log = true
config.lograge.logger = Appsignal::Logger.new(
"rails",
format: Appsignal::Logger::LOGFMT
)
config.lograge.custom_payload do |controller|
{
request_id: controller.request.request_id
}
end
end
end
```
Expand Down
11 changes: 0 additions & 11 deletions ruby_on_rails/lograge.md

This file was deleted.

0 comments on commit 05b1003

Please sign in to comment.