Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't fight against ourselves for the default log level #16622

Merged
merged 1 commit into from
Aug 22, 2014

Conversation

matthewd
Copy link
Member

If we want to always default to :debug, let's just do that.

At which point the production.rb entry can become an "uncomment to change" instead.

If we want to always default to :debug, let's just do that.

At which point the production.rb entry can become an "uncomment to
change" instead.
@rafaelfranca
Copy link
Member

:shipit:

2 similar comments
@rafaelfranca
Copy link
Member

:shipit:

@spastorino
Copy link
Contributor

:shipit:

@zzak
Copy link
Member

zzak commented Aug 22, 2014

🚢 🇮🇹

matthewd added a commit that referenced this pull request Aug 22, 2014
Don't fight against ourselves for the default log level
@matthewd matthewd merged commit 2602a49 into rails:master Aug 22, 2014
@@ -117,7 +117,7 @@ def database_configuration
end

def log_level
@log_level ||= Rails.env.production? ? :info : :debug
@log_level ||= :debug
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthewd This would change the default for existing applications too, whereas the older implementation would keep the same default for existing applications, c/d? While this is probably okay, we should at least mention it in the upgrade guides.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on this being a high risk change, people are going to be bitten by this hard. (eg: why is my app so slow, ahhh ... you have log level set to debug)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I found this change complicating the debugging process because of too many logs. So changed back to config.log_level = :info.

chancancode added a commit that referenced this pull request Nov 17, 2014
This reverts commit 2602a49, reversing
changes made to 5d7c105.

The explicit default was introduced in 21f6d72, so apps created with Rails < 4
have the commented out version, which means that this change would break those
apps.
swanandp pushed a commit to Simplero/rails that referenced this pull request Nov 18, 2014
This reverts commit 2602a49, reversing
changes made to 5d7c105.

The explicit default was introduced in 21f6d72, so apps created with Rails < 4
have the commented out version, which means that this change would break those
apps.
zzak pushed a commit to zzak/rails that referenced this pull request Nov 25, 2014
zzak pushed a commit to zzak/rails that referenced this pull request Nov 25, 2014
zzak pushed a commit to zzak/rails that referenced this pull request Nov 25, 2014
chancancode added a commit that referenced this pull request Nov 25, 2014
Add a CHANGELOG entry for #16622 and a6de6f5 [ci skip]
@matthewd matthewd deleted the default-debug branch August 22, 2015 18:38
ericpayneclio added a commit to ericpayneclio/rails that referenced this pull request Jun 23, 2020
I recently learned that Rails logs at the :debug level (not the :info
level) by default in production environments. This is a surprising
behaviour, as other popular frameworks do not log at this level
by default. It would not be surprising if a developer accidentally
logged personally identifiable information (PII) in a production
environment due to this behaviour.

I noticed that [in 2014](rails#16622), the
Rails project made an intentional decision to set the default log level
to :debug. However, the landscape around logging PII has changed since
then with the introduction of legislation like GDPR, so I thought it
prudent to reopen this discussion.
rafaelfranca pushed a commit that referenced this pull request Sep 22, 2020
I recently learned that Rails logs at the :debug level (not the :info
level) by default in production environments. This is a surprising
behaviour, as other popular frameworks do not log at this level
by default. It would not be surprising if a developer accidentally
logged personally identifiable information (PII) in a production
environment due to this behaviour.

I noticed that [in 2014](#16622), the
Rails project made an intentional decision to set the default log level
to :debug. However, the landscape around logging PII has changed since
then with the introduction of legislation like GDPR, so I thought it
prudent to reopen this discussion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants