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

Only log controller parameters when configured to. #20

Closed
wants to merge 1 commit into from
Closed

Only log controller parameters when configured to. #20

wants to merge 1 commit into from

Conversation

alext
Copy link
Contributor

@alext alext commented Jan 10, 2014

This adds a new config option log_controller_parameters, that defaults to false. This needs to be set to true to enable logging of the params hash, otherwise this is omitted.

Rationale:

The change in #14 has implications that are not immediately obvious. It will cause the elasticsearch mapping for the parameters field to become a new dynamic mapping that gets indexed. This can lead to collisions if different apps (or even different controllers within the same app) use the same params key with different types, which results in log messages being lost. It also causes the indexes to become significantly larger (in our case, this change tripled the size).

In light of this, I think the not logging these fields by default is the correct choice.

This adds a new config option `log_controller_parameters`, that defaults
to false.  This needs to be set to true to enable logging of the params
hash, otherwise this is omitted.

Rationale:

The change in #14 has implications that are not
immediately obvious.  It will cause the elasticsearch mapping for the
parameters field to become a new dynamic mapping that gets indexed.
This can lead to collisions if different apps use the same params key
with different types, which results in log messages being lost.  It also
causes the indexes to become significantly larger (in our case, this
change tripled the size).

In light of this, I think the not logging these fields by default is the
correct choice.
@ghost
Copy link

ghost commented Jan 17, 2014

Thanks for this. We have some actions with quite a few parameters, and our log size simply exploded. I'd like to see this merged into master.

alext added a commit to alphagov/errbit that referenced this pull request Jan 27, 2014
Using our branch until shadabahmed/logstasher#20
is merged
@m-barthelemy
Copy link
Contributor

Would definitely be more than useful, as new settings often make logged requests huge.
@shadabahmed : Do you plan to accept and merge this pull request?

@shadabahmed
Copy link
Owner

Looks like i can't find disable_parameter_logging branch. Getting this error while pulling it:

    git pull git@github.com:alphagov/logstasher.git disable_parameter_loggin
    fatal: Couldn't find remote ref disable_parameter_loggin

@alext
Copy link
Contributor Author

alext commented Jan 31, 2014

Missing a trailing 'g' - 'disable_parameter_logging'

shadabahmed added a commit that referenced this pull request Jan 31, 2014
@shadabahmed
Copy link
Owner

Oopsies .. done and released ..

Pushed logstasher 0.4.7 to rubygems.org

@alext
Copy link
Contributor Author

alext commented Jan 31, 2014

Hi, unless I'm missing something, the change didn't get merged in, only the version bumped...

shadabahmed added a commit that referenced this pull request Jan 31, 2014
shadabahmed added a commit that referenced this pull request Jan 31, 2014
@shadabahmed
Copy link
Owner

I am totally lost today - apologies - all merged now in 0.4.8

@alext
Copy link
Contributor Author

alext commented Jan 31, 2014

No worries, I know the feeling...

Thanks for merging.

alext added a commit to alphagov/errbit that referenced this pull request Feb 3, 2014
alext added a commit to alphagov/asset-manager that referenced this pull request Feb 17, 2014
@bradwright bradwright deleted the disable_parameter_logging branch February 17, 2014 12:35
alext added a commit to alphagov/places-manager that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/publisher that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/whitehall that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/panopticon that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/business-support-api that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/maslow that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/release that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/router-api that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/smart-answers that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/static that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/support that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/trade-tariff-admin that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/trade-tariff-frontend that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/trade-tariff-backend that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/transaction-wrappers that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/transition that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/travel-advice-publisher that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/fco-services that referenced this pull request Feb 17, 2014
alext added a commit to alphagov/whitehall that referenced this pull request Mar 10, 2014
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.

3 participants