Skip to content

Commit 272085f

Browse files
authored
Merge pull request #78 from serilog/dev
4.1.0 Release
2 parents 6d463c0 + 5b52dd2 commit 272085f

25 files changed

+660
-100
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ insert_final_newline = true
66
indent_style = space
77
indent_size = 4
88

9-
[*.{csproj,json,config,yml}]
9+
[*.{csproj,json,config,yml,props}]
1010
indent_size = 2
1111

1212
[*.sh]

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ bld/
2626
# Uncomment if you have tasks that create the project's static files in wwwroot
2727
#wwwroot/
2828

29+
# Rider cache/options directory
30+
.idea
31+
2932
# MSTest test Results
3033
[Tt]est[Rr]esult*/
3134
[Bb]uild[Ll]og.*

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ matrix:
55
- os: linux
66
dist: trusty
77
sudo: required
8-
dotnet: 2.0.0
8+
dotnet: 2.1.300
99
group: edge
1010
script:
1111
- ./build.sh

Build.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ foreach ($src in ls src/*) {
2323

2424
echo "build: Packaging project in $src"
2525

26-
& dotnet build -c Release --version-suffix=$buildSuffix
26+
& dotnet build -c Release --version-suffix=$buildSuffix -p:EnableSourceLink=true
2727
if ($suffix) {
28-
& dotnet pack -c Release --include-source -o ..\..\artifacts --version-suffix=$suffix --no-build
28+
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix --no-build
2929
} else {
30-
& dotnet pack -c Release --include-source -o ..\..\artifacts --no-build
30+
& dotnet pack -c Release -o ..\..\artifacts --no-build
3131
}
3232
if($LASTEXITCODE -ne 0) { exit 1 }
3333

README.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Serilog.Sinks.File [![Build status](https://ci.appveyor.com/api/projects/status/hh9gymy0n6tne46j?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-file) [![Travis build](https://travis-ci.org/serilog/serilog-sinks-file.svg)](https://travis-ci.org/serilog/serilog-sinks-file) [![NuGet Version](http://img.shields.io/nuget/v/Serilog.Sinks.File.svg?style=flat)](https://www.nuget.org/packages/Serilog.Sinks.File/) [![Documentation](https://img.shields.io/badge/docs-wiki-yellow.svg)](https://github.com/serilog/serilog/wiki) [![Join the chat at https://gitter.im/serilog/serilog](https://img.shields.io/gitter/room/serilog/serilog.svg)](https://gitter.im/serilog/serilog)
1+
# Serilog.Sinks.File [![Build status](https://ci.appveyor.com/api/projects/status/hh9gymy0n6tne46j?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-file) [![NuGet Version](http://img.shields.io/nuget/v/Serilog.Sinks.File.svg?style=flat)](https://www.nuget.org/packages/Serilog.Sinks.File/) [![Documentation](https://img.shields.io/badge/docs-wiki-yellow.svg)](https://github.com/serilog/serilog/wiki) [![Join the chat at https://gitter.im/serilog/serilog](https://img.shields.io/gitter/room/serilog/serilog.svg)](https://gitter.im/serilog/serilog)
22

33
Writes [Serilog](https://serilog.net) events to one or more text files.
44

55
### Getting started
66

7-
Install the [Serilog.Sinks.File](https://nuget.org/serilog/serilog-sinks-file) package from NuGet:
7+
Install the [Serilog.Sinks.File](https://www.nuget.org/packages/Serilog.Sinks.File/) package from NuGet:
88

99
```powershell
1010
Install-Package Serilog.Sinks.File
@@ -30,16 +30,18 @@ log20180702.txt
3030
3131
### Limits
3232

33-
To avoid bringing down apps with runaway disk usage the file sink **limits file size to 1GB by default**. The limit can be increased or removed using the `fileSizeLimitBytes` parameter.
33+
To avoid bringing down apps with runaway disk usage the file sink **limits file size to 1GB by default**. Once the limit is reached, no further events will be written until the next roll point (see also: [Rolling policies](#rolling-policies) below).
34+
35+
The limit can be changed or removed using the `fileSizeLimitBytes` parameter.
3436

3537
```csharp
3638
.WriteTo.File("log.txt", fileSizeLimitBytes: null)
37-
```
39+
```
3840

3941
For the same reason, only **the most recent 31 files** are retained by default (i.e. one long month). To change or remove this limit, pass the `retainedFileCountLimit` parameter.
4042

4143
```csharp
42-
.WriteTo.RollingFile("log.txt", rollingInterval: RollingInterval.Day, retainedFileCountLimit: null)
44+
.WriteTo.File("log.txt", rollingInterval: RollingInterval.Day, retainedFileCountLimit: null)
4345
```
4446

4547
### Rolling policies
@@ -86,7 +88,7 @@ In your application's `App.config` or `Web.config` file, specify the file sink a
8688
<configuration>
8789
<appSettings>
8890
<add key="serilog:using:File" value="Serilog.Sinks.File" />
89-
<add key="serilog:write-to:File.pathFormat" value="log.txt" />
91+
<add key="serilog:write-to:File.path" value="log.txt" />
9092
```
9193

9294
The parameters that can be set through the `serilog:write-to:File` keys are the method parameters accepted by the `WriteTo.File()` configuration method. This means, for example, that the `fileSizeLimitBytes` parameter can be set with:
@@ -154,8 +156,8 @@ The format is controlled using an _output template_, which the file configuratio
154156
The default format above corresponds to an output template like:
155157

156158
```csharp
157-
.WriteTo.File("log.txt",
158-
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{u3}] {Message:lj}{NewLine}{Exception}")
159+
.WriteTo.File("log.txt",
160+
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}")
159161
```
160162

161163
##### JSON event formatting

appveyor.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
version: '{build}'
22
skip_tags: true
3-
image: Visual Studio 2017
3+
image:
4+
- Visual Studio 2017
5+
- Ubuntu
46
configuration: Release
5-
install:
6-
- ps: mkdir -Force ".\build\" | Out-Null
77
build_script:
88
- ps: ./Build.ps1
9+
for:
10+
-
11+
matrix:
12+
only:
13+
- image: Ubuntu
14+
build_script:
15+
- sh build.sh
916
test: off
1017
artifacts:
1118
- path: artifacts/Serilog.*.nupkg
1219
deploy:
1320
- provider: NuGet
1421
api_key:
15-
secure: nvZ/z+pMS91b3kG4DgfES5AcmwwGoBYQxr9kp4XiJHj25SAlgdIxFx++1N0lFH2x
22+
secure: N59tiJECUYpip6tEn0xvdmDAEiP9SIzyLEFLpwiigm/8WhJvBNs13QxzT1/3/JW/
1623
skip_symbols: true
1724
on:
1825
branch: /^(master|dev)$/

build.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
#!/bin/bash
1+
#!/bin/bash
2+
3+
set -e
24
dotnet --info
5+
dotnet --list-sdks
36
dotnet restore
47

8+
echo "🤖 Attempting to build..."
59
for path in src/**/*.csproj; do
610
dotnet build -f netstandard1.3 -c Release ${path}
11+
dotnet build -f netstandard2.0 -c Release ${path}
712
done
813

14+
echo "🤖 Running tests..."
915
for path in test/*.Tests/*.csproj; do
1016
dotnet test -f netcoreapp2.0 -c Release ${path}
1117
done

serilog-sinks-file.sln

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{E9D1B5E1-DEB9-4A04-8BAB-24EC7240ADAF}"
99
ProjectSection(SolutionItems) = preProject
1010
.editorconfig = .editorconfig
11-
.travis.yml = .travis.yml
1211
appveyor.yml = appveyor.yml
1312
Build.ps1 = Build.ps1
1413
build.sh = build.sh

0 commit comments

Comments
 (0)