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

WhenRepeatedFilter - Log after timeout #2297

Merged
merged 1 commit into from
Sep 30, 2017

Conversation

snakefoot
Copy link
Contributor

@snakefoot snakefoot commented Sep 28, 2017

Attempt to resolve #2295

Added new property IncludeFirst=true/false (default=false), that controls whether it applies the configured action to the initial logevent.

When IncludeFirst=true then the initial logevent will start a timeout-period (but without it being logged), so only when the timeout-period expires then the first logevent is logged.

@codecov
Copy link

codecov bot commented Sep 28, 2017

Codecov Report

Merging #2297 into master will increase coverage by <1%.
The diff coverage is 96%.

@@           Coverage Diff           @@
##           master   #2297    +/-   ##
=======================================
+ Coverage      82%     82%   +<1%     
=======================================
  Files         304     304            
  Lines       21414   21429    +15     
  Branches     2579    2581     +2     
=======================================
+ Hits        17517   17547    +30     
+ Misses       3229    3227     -2     
+ Partials      668     655    -13

@304NotModified
Copy link
Member

How does this resolve #2295?

@snakefoot
Copy link
Contributor Author

snakefoot commented Sep 28, 2017

whenRepeated action="ignore" means first logevent is logged, and ignores everything else until timeout expires, where it logs again.

whenRepeated action="log" means first logevent is ignored, and also ignores everything else until timeout expires, where it logs first time.

@snakefoot
Copy link
Contributor Author

snakefoot commented Sep 28, 2017

Could also consider not abusing the Action-property. But just introduce a new property called IncludeFirst=true/false (default=false), where it also applies the action to the initial event starting the timeout-period.

@Mykezero
Copy link

Hi @snakefoot, this is exactly the functionality I was looking for!

@304NotModified
Copy link
Member

OK great! great work @snakefoot !

@304NotModified 304NotModified merged commit cc9c912 into NLog:master Sep 30, 2017
@snakefoot snakefoot deleted the WhenRepeatedLogAfterTimeout branch October 10, 2017 20:36
@snakefoot snakefoot mentioned this pull request Nov 23, 2017
@snakefoot
Copy link
Contributor Author

Updated documentation:

https://github.com/NLog/NLog/wiki/WhenRepeated-Filter

@304NotModified 304NotModified added the documentation done all docs done (wiki, api docs, lists on nlog-project.org, xmldocs) label Nov 27, 2017
@snakefoot snakefoot modified the milestones: 4.5 beta 3, 4.5 Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation done all docs done (wiki, api docs, lists on nlog-project.org, xmldocs) feature needs documentation on wiki
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants