NickCraver / StackExchange.Exceptional

Error handler used for the Stack Exchange network
https://nickcraver.com/StackExchange.Exceptional/
Apache License 2.0
862 stars 170 forks source link

Prevent Certain Form Elements From Being Logged #64

Closed mmillican closed 8 years ago

mmillican commented 8 years ago

I know it is possible to ignore exceptions by regex or by system type, however, I am wondering if it's possible to ignore certain form data (eg, passwords) from being logged with an exception. I would like to be able to log possible exceptions from items that deal with sensitive data, but obviously don't want that stored in plain text.

NickCraver commented 8 years ago

Yep, this is supported. You can do this via the LogFilter, here's an example from our OpenID Provider:

  <Exceptional applicationName="Open ID">
    <LogFilters>
      <Form>
        <add name="password" replaceWith="********" />
        <add name="password2" replaceWith="********" />
      </Form>
    </LogFilters>
    <ErrorStore type="Memory" />
  </Exceptional>
mmillican commented 8 years ago

Should have known :). I also see it in the example now.

Thanks @NickCraver