You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-8
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
# Serilog.Sinks.File [](https://ci.appveyor.com/project/serilog/serilog-sinks-file)[](https://travis-ci.org/serilog/serilog-sinks-file)[](https://www.nuget.org/packages/Serilog.Sinks.File/)[](https://github.com/serilog/serilog/wiki)[](https://gitter.im/serilog/serilog)
1
+
# Serilog.Sinks.File [](https://ci.appveyor.com/project/serilog/serilog-sinks-file)[](https://www.nuget.org/packages/Serilog.Sinks.File/)[](https://github.com/serilog/serilog/wiki)[](https://gitter.im/serilog/serilog)
2
2
3
3
Writes [Serilog](https://serilog.net) events to one or more text files.
4
4
5
5
### Getting started
6
6
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:
8
8
9
9
```powershell
10
10
Install-Package Serilog.Sinks.File
@@ -30,16 +30,18 @@ log20180702.txt
30
30
31
31
### Limits
32
32
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.
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.
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
154
156
The default format above corresponds to an output template like:
0 commit comments