Skip to content

Commit

Permalink
feat: logging level switch (#309)
Browse files Browse the repository at this point in the history
Add support for specifying a log level switch when creating the sink.

Closes #311
---------

Co-authored-by: Yuriy <yuriy,[email protected]>
Co-authored-by: FantasticFiasco <[email protected]>
  • Loading branch information
3 people authored Apr 12, 2023
1 parent 068b0b4 commit e9e1826
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 29 deletions.
10 changes: 10 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,16 @@
"contributions": [
"ideas"
]
},
{
"login": "yuriy-millen",
"name": "Yuriy Millen",
"avatar_url": "https://avatars.githubusercontent.com/u/90191982?v=4",
"profile": "https://github.com/yuriy-millen",
"contributions": [
"code",
"ideas"
]
}
],
"contributorsPerLine": 7
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ This project adheres to [Semantic Versioning](http://semver.org/) and is followi

## Unreleased

### :zap: Added

- [#311](https://github.com/FantasticFiasco/serilog-sinks-http/issues/311) [BREAKING CHANGE] Support specifying `levelSwitch` when creating the sink, thus adding the support to [dynamically change the log level at runtime](https://nblumhardt.com/2014/10/dynamically-changing-the-serilog-level/) (contribution by [@yuriy-millen](https://github.com/yuriy-millen))

**Migration guide**

The parameter `levelSwitch` has been introduced to the methods `Http`, `DurableHttpUsingFileSizeRolledBuffers` and `DurableHttpUsingTimeRolledBuffers`. Please verify that the arguments pass by you to these methods still align with your intentions.

To automatically mitigate this kind of *new parameter issue* in the future, move from using positional arguments to named arguments instead.

## [8.0.0] - 2022-04-10

### :zap: Added
Expand All @@ -16,7 +26,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) and is followi

The parameter `batchSizeLimitBytes` has been introduced to the methods `Http`, `DurableHttpUsingFileSizeRolledBuffers` and `DurableHttpUsingTimeRolledBuffers`. Please verify that the arguments pass by you to these methods still align with your intentions.

To automatically mitigate this kind of *new parameter issue* in the future would be to move from using positional arguments to use named arguments.
To automatically mitigate this kind of *new parameter issue* in the future, move from using positional arguments to named arguments instead.

- [#166](https://github.com/FantasticFiasco/serilog-sinks-http/issues/166) Support for content encoding [Gzip](https://en.wikipedia.org/wiki/Gzip) using HTTP client `JsonGzipHttpClient` (contribution by [@vaibhavepatel](https://github.com/vaibhavepatel), [@KalininAndreyVictorovich](https://github.com/KalininAndreyVictorovich) and [@AntonSmolkov](https://github.com/AntonSmolkov))
- [#166](https://github.com/FantasticFiasco/serilog-sinks-http/issues/166) Support for specifying `HttpClient` when creating `JsonHttpClient` and `JsonGzipHttpClient`
Expand Down
41 changes: 23 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,24 +149,29 @@ The following users have made significant contributions to this project. Thank y
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://jetbrains.com/opensource"><img src="https://avatars.githubusercontent.com/u/878437?v=4?s=100" width="100px;" alt=""/><br /><sub><b>JetBrains</b></sub></a><br /><a href="#infra-JetBrains" title="Infrastructure (Hosting, Build-Tools, etc)">πŸš‡</a></td>
<td align="center"><a href="https://augustoproiete.net/"><img src="https://avatars.githubusercontent.com/u/177608?v=4?s=100" width="100px;" alt=""/><br /><sub><b>C. Augusto Proiete</b></sub></a><br /><a href="#financial-augustoproiete" title="Financial">πŸ’΅</a> <a href="#question-augustoproiete" title="Answering Questions">πŸ’¬</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=augustoproiete" title="Code">πŸ’»</a> <a href="#ideas-augustoproiete" title="Ideas, Planning, & Feedback">πŸ€”</a></td>
<td align="center"><a href="https://github.com/lhaussknecht"><img src="https://avatars.githubusercontent.com/u/140147?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Louis Haußknecht</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=lhaussknecht" title="Code">πŸ’»</a> <a href="#ideas-lhaussknecht" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Alhaussknecht" title="Bug reports">πŸ›</a></td>
<td align="center"><a href="https://github.com/rob-somerville"><img src="https://avatars.githubusercontent.com/u/12766610?v=4?s=100" width="100px;" alt=""/><br /><sub><b>rob-somerville</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=rob-somerville" title="Code">πŸ’»</a> <a href="#ideas-rob-somerville" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Arob-somerville" title="Bug reports">πŸ›</a></td>
<td align="center"><a href="https://github.com/kvpt"><img src="https://avatars.githubusercontent.com/u/1446221?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kevin Petit</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=kvpt" title="Code">πŸ’»</a> <a href="#ideas-kvpt" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Akvpt" title="Bug reports">πŸ›</a></td>
<td align="center"><a href="https://github.com/aleksaradz"><img src="https://avatars.githubusercontent.com/u/72725560?v=4?s=100" width="100px;" alt=""/><br /><sub><b>aleksaradz</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=aleksaradz" title="Code">πŸ’»</a> <a href="#ideas-aleksaradz" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Aaleksaradz" title="Bug reports">πŸ›</a></td>
<td align="center"><a href="https://github.com/michaeltdaniels"><img src="https://avatars.githubusercontent.com/u/45430678?v=4?s=100" width="100px;" alt=""/><br /><sub><b>michaeltdaniels</b></sub></a><br /><a href="#ideas-michaeltdaniels" title="Ideas, Planning, & Feedback">πŸ€”</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/dusse1dorf"><img src="https://avatars.githubusercontent.com/u/37047967?v=4?s=100" width="100px;" alt=""/><br /><sub><b>dusse1dorf</b></sub></a><br /><a href="#ideas-dusse1dorf" title="Ideas, Planning, & Feedback">πŸ€”</a></td>
<td align="center"><a href="https://github.com/vaibhavepatel"><img src="https://avatars.githubusercontent.com/u/23142694?v=4?s=100" width="100px;" alt=""/><br /><sub><b>vaibhavepatel</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Avaibhavepatel" title="Bug reports">πŸ›</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=vaibhavepatel" title="Code">πŸ’»</a> <a href="#ideas-vaibhavepatel" title="Ideas, Planning, & Feedback">πŸ€”</a></td>
<td align="center"><a href="https://github.com/KalininAndreyVictorovich"><img src="https://avatars.githubusercontent.com/u/1285535?v=4?s=100" width="100px;" alt=""/><br /><sub><b>KalininAndreyVictorovich</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3AKalininAndreyVictorovich" title="Bug reports">πŸ›</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=KalininAndreyVictorovich" title="Code">πŸ’»</a></td>
<td align="center"><a href="https://github.com/tipasergio"><img src="https://avatars.githubusercontent.com/u/6435956?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sergios</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Atipasergio" title="Bug reports">πŸ›</a></td>
<td align="center"><a href="https://github.com/AntonSmolkov"><img src="https://avatars.githubusercontent.com/u/5318028?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Anton Smolkov</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=AntonSmolkov" title="Code">πŸ’»</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3AAntonSmolkov" title="Bug reports">πŸ›</a></td>
<td align="center"><a href="https://github.com/Siphonophora"><img src="https://avatars.githubusercontent.com/u/32316111?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Michael J Conrad</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=Siphonophora" title="Documentation">πŸ“–</a></td>
<td align="center"><a href="https://github.com/seruminar"><img src="https://avatars.githubusercontent.com/u/35008875?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Yuriy Sountsov</b></sub></a><br /><a href="#ideas-seruminar" title="Ideas, Planning, & Feedback">πŸ€”</a></td>
</tr>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://jetbrains.com/opensource"><img src="https://avatars.githubusercontent.com/u/878437?v=4?s=100" width="100px;" alt="JetBrains"/><br /><sub><b>JetBrains</b></sub></a><br /><a href="#infra-JetBrains" title="Infrastructure (Hosting, Build-Tools, etc)">πŸš‡</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://augustoproiete.net/"><img src="https://avatars.githubusercontent.com/u/177608?v=4?s=100" width="100px;" alt="C. Augusto Proiete"/><br /><sub><b>C. Augusto Proiete</b></sub></a><br /><a href="#financial-augustoproiete" title="Financial">πŸ’΅</a> <a href="#question-augustoproiete" title="Answering Questions">πŸ’¬</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=augustoproiete" title="Code">πŸ’»</a> <a href="#ideas-augustoproiete" title="Ideas, Planning, & Feedback">πŸ€”</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lhaussknecht"><img src="https://avatars.githubusercontent.com/u/140147?v=4?s=100" width="100px;" alt="Louis Haußknecht"/><br /><sub><b>Louis Haußknecht</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=lhaussknecht" title="Code">πŸ’»</a> <a href="#ideas-lhaussknecht" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Alhaussknecht" title="Bug reports">πŸ›</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rob-somerville"><img src="https://avatars.githubusercontent.com/u/12766610?v=4?s=100" width="100px;" alt="rob-somerville"/><br /><sub><b>rob-somerville</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=rob-somerville" title="Code">πŸ’»</a> <a href="#ideas-rob-somerville" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Arob-somerville" title="Bug reports">πŸ›</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kvpt"><img src="https://avatars.githubusercontent.com/u/1446221?v=4?s=100" width="100px;" alt="Kevin Petit"/><br /><sub><b>Kevin Petit</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=kvpt" title="Code">πŸ’»</a> <a href="#ideas-kvpt" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Akvpt" title="Bug reports">πŸ›</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/aleksaradz"><img src="https://avatars.githubusercontent.com/u/72725560?v=4?s=100" width="100px;" alt="aleksaradz"/><br /><sub><b>aleksaradz</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=aleksaradz" title="Code">πŸ’»</a> <a href="#ideas-aleksaradz" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Aaleksaradz" title="Bug reports">πŸ›</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/michaeltdaniels"><img src="https://avatars.githubusercontent.com/u/45430678?v=4?s=100" width="100px;" alt="michaeltdaniels"/><br /><sub><b>michaeltdaniels</b></sub></a><br /><a href="#ideas-michaeltdaniels" title="Ideas, Planning, & Feedback">πŸ€”</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/dusse1dorf"><img src="https://avatars.githubusercontent.com/u/37047967?v=4?s=100" width="100px;" alt="dusse1dorf"/><br /><sub><b>dusse1dorf</b></sub></a><br /><a href="#ideas-dusse1dorf" title="Ideas, Planning, & Feedback">πŸ€”</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/vaibhavepatel"><img src="https://avatars.githubusercontent.com/u/23142694?v=4?s=100" width="100px;" alt="vaibhavepatel"/><br /><sub><b>vaibhavepatel</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Avaibhavepatel" title="Bug reports">πŸ›</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=vaibhavepatel" title="Code">πŸ’»</a> <a href="#ideas-vaibhavepatel" title="Ideas, Planning, & Feedback">πŸ€”</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/KalininAndreyVictorovich"><img src="https://avatars.githubusercontent.com/u/1285535?v=4?s=100" width="100px;" alt="KalininAndreyVictorovich"/><br /><sub><b>KalininAndreyVictorovich</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3AKalininAndreyVictorovich" title="Bug reports">πŸ›</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=KalininAndreyVictorovich" title="Code">πŸ’»</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tipasergio"><img src="https://avatars.githubusercontent.com/u/6435956?v=4?s=100" width="100px;" alt="Sergios"/><br /><sub><b>Sergios</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3Atipasergio" title="Bug reports">πŸ›</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/AntonSmolkov"><img src="https://avatars.githubusercontent.com/u/5318028?v=4?s=100" width="100px;" alt="Anton Smolkov"/><br /><sub><b>Anton Smolkov</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=AntonSmolkov" title="Code">πŸ’»</a> <a href="https://github.com/FantasticFiasco/serilog-sinks-http/issues?q=author%3AAntonSmolkov" title="Bug reports">πŸ›</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Siphonophora"><img src="https://avatars.githubusercontent.com/u/32316111?v=4?s=100" width="100px;" alt="Michael J Conrad"/><br /><sub><b>Michael J Conrad</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=Siphonophora" title="Documentation">πŸ“–</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/seruminar"><img src="https://avatars.githubusercontent.com/u/35008875?v=4?s=100" width="100px;" alt="Yuriy Sountsov"/><br /><sub><b>Yuriy Sountsov</b></sub></a><br /><a href="#ideas-seruminar" title="Ideas, Planning, & Feedback">πŸ€”</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/yuriy-millen"><img src="https://avatars.githubusercontent.com/u/90191982?v=4?s=100" width="100px;" alt="Yuriy Millen"/><br /><sub><b>Yuriy Millen</b></sub></a><br /><a href="https://github.com/FantasticFiasco/serilog-sinks-http/commits?author=yuriy-millen" title="Code">πŸ’»</a> <a href="#ideas-yuriy-millen" title="Ideas, Planning, & Feedback">πŸ€”</a></td>
</tr>
</tbody>
</table>

<!-- markdownlint-restore -->
Expand Down
8 changes: 4 additions & 4 deletions build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ if ($is_tagged_build) {
New-Item -ItemType Directory -Path .\artifacts
dotnet pack -c Release --no-build
AssertLastExitCode
Move-Item -Path .\src\bin\Release\*.nupkg -Destination .\artifacts
Move-Item -Path .\src\bin\Release\*.snupkg -Destination .\artifacts
Move-Item -Path .\src\Serilog.Sinks.Http\bin\Release\*.nupkg -Destination .\artifacts
Move-Item -Path .\src\Serilog.Sinks.Http\bin\Release\*.snupkg -Destination .\artifacts
} else {
# Use git tag if version suffix isn't specified
if ($version_suffix -eq "") {
Expand All @@ -73,8 +73,8 @@ if ($is_tagged_build) {
New-Item -ItemType Directory -Path .\artifacts
dotnet pack -c Release --version-suffix=$version_suffix --no-build
AssertLastExitCode
Move-Item -Path .\src\bin\Release\*.nupkg -Destination .\artifacts
Move-Item -Path .\src\bin\Release\*.snupkg -Destination .\artifacts
Move-Item -Path .\src\Serilog.Sinks.Http\bin\Release\*.nupkg -Destination .\artifacts
Move-Item -Path .\src\Serilog.Sinks.Http\bin\Release\*.snupkg -Destination .\artifacts
}

# -------------------------------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit e9e1826

Please sign in to comment.