1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-22 06:39:39 +02:00
This commit is contained in:
Josh Pigford 2025-02-03 19:49:41 -06:00
parent 89027f1fbf
commit 983729cbdf
3 changed files with 24 additions and 4 deletions

View file

@ -31,6 +31,7 @@ gem "stackprof"
gem "rack-mini-profiler" gem "rack-mini-profiler"
gem "sentry-ruby" gem "sentry-ruby"
gem "sentry-rails" gem "sentry-rails"
gem "logtail-rails"
# Active Storage # Active Storage
gem "aws-sdk-s3", "~> 1.177.0", require: false gem "aws-sdk-s3", "~> 1.177.0", require: false

View file

@ -243,6 +243,17 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3) rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10) rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.5) logger (1.6.5)
logtail (0.1.13)
msgpack (~> 1.0)
logtail-rack (0.2.5)
logtail (~> 0.1)
rack (>= 1.2, < 4.0)
logtail-rails (0.2.9)
actionpack (>= 5.0.0)
activerecord (>= 5.0.0)
logtail (~> 0.1)
logtail-rack (~> 0.1)
railties (>= 5.0.0)
loofah (2.24.0) loofah (2.24.0)
crass (~> 1.0.2) crass (~> 1.0.2)
nokogiri (>= 1.12.0) nokogiri (>= 1.12.0)
@ -527,6 +538,7 @@ DEPENDENCIES
intercom-rails intercom-rails
jwt jwt
letter_opener letter_opener
logtail-rails
lucide-rails! lucide-rails!
mocha mocha
octokit octokit

View file

@ -48,10 +48,17 @@ Rails.application.configure do
# Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies. # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
config.assume_ssl = ActiveModel::Type::Boolean.new.cast(ENV.fetch("RAILS_ASSUME_SSL", true)) config.assume_ssl = ActiveModel::Type::Boolean.new.cast(ENV.fetch("RAILS_ASSUME_SSL", true))
# Log to STDOUT by default # Log to Logtail if API key is present, otherwise log to STDOUT
config.logger = ActiveSupport::Logger.new(STDOUT) config.logger = if ENV["LOGTAIL_API_KEY"].present?
Logtail::Logger.create_default_logger(
ENV["LOGTAIL_API_KEY"],
telemetry_host: "in.logs.betterstack.com"
)
else
ActiveSupport::Logger.new(STDOUT)
.tap { |logger| logger.formatter = ::Logger::Formatter.new } .tap { |logger| logger.formatter = ::Logger::Formatter.new }
.then { |logger| ActiveSupport::TaggedLogging.new(logger) } .then { |logger| ActiveSupport::TaggedLogging.new(logger) }
end
# Prepend all log lines with the following tags. # Prepend all log lines with the following tags.
config.log_tags = [ :request_id ] config.log_tags = [ :request_id ]