Skip to content

2.2.0 Release #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
}
}
}
}