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 to ELMAH if there's an exception #16

Open
RudeySH opened this issue Dec 31, 2017 · 1 comment
Open

Only log to ELMAH if there's an exception #16

RudeySH opened this issue Dec 31, 2017 · 1 comment

Comments

@RudeySH
Copy link

RudeySH commented Dec 31, 2017

Can we get an option to only send logs to ELMAH when there's a logged exception to go with it?

@snakefoot
Copy link
Contributor

You can setup a filter, to only perform target-output on exceptions:

<rules>
    <logger name="*" minLevel="Warn" writeTo="elmah">
        <filters>
            <when condition="length('${exception:format=type}') > 0" action="Log" />
        </filters>
    </logger>
</rules>

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

No branches or pull requests

2 participants