Skip to content

Commit

Permalink
Merge pull request #11 from serilog/dev
Browse files Browse the repository at this point in the history
2.2.0 Release
  • Loading branch information
nblumhardt authored Jul 28, 2016
2 parents 0cbc2c3 + 5c28e53 commit 8f6975a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 4 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
- DotNet Core support
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<add key="serilog:using:File" value="Serilog.Sinks.File" />
<add key="serilog:write-to:File.path" value="log.txt" />
<add key="serilog:write-to:File.fileSizeLimitBytes" value="" />
```
Expand Down
6 changes: 3 additions & 3 deletions src/Serilog.Sinks.File/Sinks/File/FileSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(encoderShouldEmitUTF8Identifier: false));
if (fileSizeLimitBytes != null)
{
var initialBytes = file.Length;
Expand Down Expand Up @@ -106,4 +106,4 @@ public void Emit(LogEvent logEvent)
/// </summary>
public void Dispose() => _output.Dispose();
}
}
}
7 changes: 4 additions & 3 deletions src/Serilog.Sinks.File/project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.1.0-*",
"version": "2.2.0-*",
"description": "Write Serilog events to a text file in plain or JSON format.",
"authors": [ "Serilog Contributors" ],
"packOptions": {
Expand All @@ -21,8 +21,9 @@
"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"
}
}
}
}
}

0 comments on commit 8f6975a

Please sign in to comment.