Skip to content

Commit

Permalink
fix: remove trimming log events (#74)
Browse files Browse the repository at this point in the history
Leading and trailing white-space characters are no longer removed from the payload before
being sent over the network, thus respecting output templates that use those characters.

Closes #73
  • Loading branch information
FantasticFiasco authored Mar 9, 2020
1 parent f37f07f commit 00bb1b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ This project adheres to [Semantic Versioning](http://semver.org/) and is followi

## Unreleased

### :syringe: Fixed

- [#73](https://github.com/FantasticFiasco/serilog-sinks-udp/pull/73) [BREAKING CHANGE] Leading and trailing white-space characters are no longer removed from the payload before being sent over the network, thus respecting output templates that use those characters. (discovered by [@tagcode](https://github.com/tagcode))

## [6.0.0] - 2019-07-08

### :syringe: Fixed
Expand Down
4 changes: 2 additions & 2 deletions serilog-sinks-udp.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26114.2
# Visual Studio Version 16
VisualStudioVersion = 16.0.29806.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "documentation", "documentation", "{21948E8D-F145-4F2C-86FF-95521C2F7D5C}"
ProjectSection(SolutionItems) = preProject
Expand Down
3 changes: 1 addition & 2 deletions src/Serilog.Sinks.Udp/Sinks/Udp/Private/UdpSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ protected override async Task EmitBatchAsync(IEnumerable<LogEvent> events)
byte[] buffer = Encoding.UTF8.GetBytes(
stringWriter
.ToString()
.Trim()
.ToCharArray());

if (remoteEndPoint.IPEndPoint != null)
Expand Down Expand Up @@ -105,4 +104,4 @@ protected override void Dispose(bool disposing)

#endregion
}
}
}

0 comments on commit 00bb1b1

Please sign in to comment.