From 61bd11528822688c29360973ec5e49abb1a2ceb9 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Tue, 5 Jul 2016 09:04:58 +1000 Subject: [PATCH 1/6] Bump dev package version [Skip CI] --- src/Serilog.Sinks.File/project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Serilog.Sinks.File/project.json b/src/Serilog.Sinks.File/project.json index cd35902..041480c 100644 --- a/src/Serilog.Sinks.File/project.json +++ b/src/Serilog.Sinks.File/project.json @@ -1,5 +1,5 @@ { - "version": "2.1.0-*", + "version": "2.1.1-*", "description": "Write Serilog events to a text file in plain or JSON format.", "authors": [ "Serilog Contributors" ], "packOptions": { From e86fe339c522c65a1a843b0506215356bbd98d7e Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Wed, 6 Jul 2016 09:25:04 +1000 Subject: [PATCH 2/6] Add missing `serilog:using` key to XML example [Skip CI] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5f5b17e..b8ab721 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ To avoid bringing down apps with runaway disk usage the file sink **limits file The sink can be configured in XML [app-settings format](https://github.com/serilog/serilog/wiki/AppSettings) if the _Serilog.Settings.AppSettings_ package is in use: ```xml + ``` From 70b46fa29452cc6b8c69837adc82487867056e2c Mon Sep 17 00:00:00 2001 From: Christian Melendez Date: Tue, 26 Jul 2016 09:22:37 -0600 Subject: [PATCH 3/6] Changed the UTF Encoding instance to avoid inserting the BOM character --- src/Serilog.Sinks.File/Sinks/File/FileSink.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Serilog.Sinks.File/Sinks/File/FileSink.cs b/src/Serilog.Sinks.File/Sinks/File/FileSink.cs index cbfc37f..7b982a6 100644 --- a/src/Serilog.Sinks.File/Sinks/File/FileSink.cs +++ b/src/Serilog.Sinks.File/Sinks/File/FileSink.cs @@ -56,7 +56,7 @@ public FileSink(string path, ITextFormatter textFormatter, long? fileSizeLimitBy TryCreateDirectory(path); var file = System.IO.File.Open(path, FileMode.Append, FileAccess.Write, FileShare.Read); - var outputWriter = new StreamWriter(file, encoding ?? Encoding.UTF8); + var outputWriter = new StreamWriter(file, encoding ?? new UTF8Encoding(false)); if (fileSizeLimitBytes != null) { var initialBytes = file.Length; @@ -106,4 +106,4 @@ public void Emit(LogEvent logEvent) /// public void Dispose() => _output.Dispose(); } -} \ No newline at end of file +} From c723d182b651f45a4089dd4a033c76eaa0c110b9 Mon Sep 17 00:00:00 2001 From: Christian Melendez Date: Wed, 27 Jul 2016 09:59:37 -0600 Subject: [PATCH 4/6] Added the UTF8 encoder without the BOM character --- src/Serilog.Sinks.File/Sinks/File/FileSink.cs | 4 ++-- src/Serilog.Sinks.File/project.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Serilog.Sinks.File/Sinks/File/FileSink.cs b/src/Serilog.Sinks.File/Sinks/File/FileSink.cs index 7b982a6..8268654 100644 --- a/src/Serilog.Sinks.File/Sinks/File/FileSink.cs +++ b/src/Serilog.Sinks.File/Sinks/File/FileSink.cs @@ -13,7 +13,7 @@ // limitations under the License. using System; -using System.IO; +using System.IO; using System.Text; using Serilog.Core; using Serilog.Debugging; @@ -56,7 +56,7 @@ public FileSink(string path, ITextFormatter textFormatter, long? fileSizeLimitBy TryCreateDirectory(path); var file = System.IO.File.Open(path, FileMode.Append, FileAccess.Write, FileShare.Read); - var outputWriter = new StreamWriter(file, encoding ?? new UTF8Encoding(false)); + var outputWriter = new StreamWriter(file, encoding ?? new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); if (fileSizeLimitBytes != null) { var initialBytes = file.Length; diff --git a/src/Serilog.Sinks.File/project.json b/src/Serilog.Sinks.File/project.json index 041480c..5f9f0dd 100644 --- a/src/Serilog.Sinks.File/project.json +++ b/src/Serilog.Sinks.File/project.json @@ -21,7 +21,8 @@ "dependencies": { "System.IO": "4.1.0", "System.IO.FileSystem": "4.0.1", - "System.IO.FileSystem.Primitives": "4.0.1" + "System.IO.FileSystem.Primitives": "4.0.1", + "System.Text.Encoding.Extensions": "4.0.11" } } } From 751aa66a71b382dc4cac4e5c6b530b852db553b7 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Thu, 28 Jul 2016 10:43:38 +1000 Subject: [PATCH 5/6] Updated changelist [Skip CI] --- CHANGES.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 82f849c..e6816dc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,9 @@ +2.2.0 + - #9 - default to UTF-8 encoding without BOM + 2.1.0 - Support alternative `ITextFormatter`s through the configuration API (#4) 2.0.0 - Moved to new project - - DotNet Core support \ No newline at end of file + - DotNet Core support From 5c28e53a9477a365d33724c47437aaaf0b8b29a7 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Thu, 28 Jul 2016 10:44:02 +1000 Subject: [PATCH 6/6] Dev version bump --- src/Serilog.Sinks.File/project.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Serilog.Sinks.File/project.json b/src/Serilog.Sinks.File/project.json index 5f9f0dd..3961ead 100644 --- a/src/Serilog.Sinks.File/project.json +++ b/src/Serilog.Sinks.File/project.json @@ -1,5 +1,5 @@ { - "version": "2.1.1-*", + "version": "2.2.0-*", "description": "Write Serilog events to a text file in plain or JSON format.", "authors": [ "Serilog Contributors" ], "packOptions": { @@ -26,4 +26,4 @@ } } } -} \ No newline at end of file +}