Skip to content

Commit 8f6975a

Browse files
authored
Merge pull request #11 from serilog/dev
2.2.0 Release
2 parents 0cbc2c3 + 5c28e53 commit 8f6975a

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

CHANGES.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
2.2.0
2+
- #9 - default to UTF-8 encoding without BOM
3+
14
2.1.0
25
- Support alternative `ITextFormatter`s through the configuration API (#4)
36

47
2.0.0
58
- Moved to new project
6-
- DotNet Core support
9+
- DotNet Core support

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ To avoid bringing down apps with runaway disk usage the file sink **limits file
2121
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:
2222

2323
```xml
24+
<add key="serilog:using:File" value="Serilog.Sinks.File" />
2425
<add key="serilog:write-to:File.path" value="log.txt" />
2526
<add key="serilog:write-to:File.fileSizeLimitBytes" value="" />
2627
```

src/Serilog.Sinks.File/Sinks/File/FileSink.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
using System;
16-
using System.IO;
16+
using System.IO;
1717
using System.Text;
1818
using Serilog.Core;
1919
using Serilog.Debugging;
@@ -56,7 +56,7 @@ public FileSink(string path, ITextFormatter textFormatter, long? fileSizeLimitBy
5656
TryCreateDirectory(path);
5757

5858
var file = System.IO.File.Open(path, FileMode.Append, FileAccess.Write, FileShare.Read);
59-
var outputWriter = new StreamWriter(file, encoding ?? Encoding.UTF8);
59+
var outputWriter = new StreamWriter(file, encoding ?? new UTF8Encoding(encoderShouldEmitUTF8Identifier: false));
6060
if (fileSizeLimitBytes != null)
6161
{
6262
var initialBytes = file.Length;
@@ -106,4 +106,4 @@ public void Emit(LogEvent logEvent)
106106
/// </summary>
107107
public void Dispose() => _output.Dispose();
108108
}
109-
}
109+
}

src/Serilog.Sinks.File/project.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.1.0-*",
2+
"version": "2.2.0-*",
33
"description": "Write Serilog events to a text file in plain or JSON format.",
44
"authors": [ "Serilog Contributors" ],
55
"packOptions": {
@@ -21,8 +21,9 @@
2121
"dependencies": {
2222
"System.IO": "4.1.0",
2323
"System.IO.FileSystem": "4.0.1",
24-
"System.IO.FileSystem.Primitives": "4.0.1"
24+
"System.IO.FileSystem.Primitives": "4.0.1",
25+
"System.Text.Encoding.Extensions": "4.0.11"
2526
}
2627
}
2728
}
28-
}
29+
}

0 commit comments

Comments
 (0)