Skip to content

Commit

Permalink
Allow alternative log level and break app on user not saved (#689)
Browse files Browse the repository at this point in the history
* Allow RAILS_LOG_LEVEL to define alternative log level in production

* Force server error when a user cannot be saved
  • Loading branch information
pil0u authored Nov 20, 2024
1 parent d1ed082 commit 6ccfb5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def self.from_kitt(auth)
user.github_username = auth.info.github_nickname
user.original_city_id = original_city.id

user.save
user.save!
user
end

Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

# Include generic and useful information about system operation, but avoid logging too much
# information to avoid inadvertent exposure of personally identifiable information (PII).
config.log_level = :info
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", :info)

# Prepend all log lines with the following tags.
config.log_tags = [:request_id]
Expand Down

0 comments on commit 6ccfb5e

Please sign in to comment.