Skip to content

4.1.0 Release #78

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 48 commits into from
Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
f197183
Dev version bump [Skip CI]
nblumhardt Oct 30, 2017
55c5aa2
Renamed `pathFormat` to correct `path` in example - #38 [Skip CI]
nblumhardt Oct 30, 2017
b8bb2cc
Fix link to nuget package page
tsimbalar Nov 29, 2017
0c2e485
Docs: Fix level output in default format
bbrandt Feb 21, 2018
069f0f7
Merge pull request #50 from bbrandt/patch-1
nblumhardt Feb 21, 2018
56b3753
Try to fit the example output template within the margins [Skip CI]
nblumhardt Feb 22, 2018
9fe9c0d
Fix remaining reference to RollingFile sink
tsimbalar Mar 5, 2018
27739bb
Merge pull request #52 from serilog/readme-rollingfile
nblumhardt Mar 6, 2018
f18cb0e
New NuGet API Key
merbla May 9, 2018
37a2bfe
fixing repository url
MaximRouiller Sep 21, 2018
543d861
Merge pull request #62 from MaximRouiller/repositoryurl
nblumhardt Sep 21, 2018
9903036
add SourceLink support
Nov 3, 2018
1270a76
move SourceLink configuration from Directory.Build.prop into csproj;
Nov 14, 2018
d2856bf
Merge pull request #65 from lrushl/sourcelink-support
nblumhardt Nov 15, 2018
b952e33
Add target for .net standard 2.0
Jan 10, 2019
195f959
Remove System.IO and System.IO.FileSystem.Primitives from dependencies
Jan 14, 2019
b472fc8
Update minor version to reflect added capability
nblumhardt Jan 17, 2019
ab9fc9f
Merge pull request #76 from vhatsura/netstandard20_target
nblumhardt Jan 17, 2019
f7bfe4e
Enabled FileSink and RollingFileSink's output stream in another strea…
cocowalla Feb 1, 2019
9eee731
Rename StreamWrapper to FileLifecycleHooks
cocowalla Feb 14, 2019
83d817f
Ignore Rider cache/options files
cocowalla Feb 14, 2019
63c3601
Add docs re wrapped stream ownership
cocowalla Feb 14, 2019
fca6eb9
Check for directory existence before attempting access.
billrob Mar 12, 2019
0c65484
Merge pull request #88 from billrob/dev
nblumhardt Mar 13, 2019
e604418
Improve log message when FileLifecycleHooks provided for a shared log…
cocowalla Apr 20, 2019
873f6d4
Throw clear exception when wrapping the output stream returns null
cocowalla Apr 20, 2019
e310ab9
Throw when using hooks with a shared file
cocowalla Apr 20, 2019
1864db1
Merge branch 'feature/stream-wrapper' of https://github.com/cocowalla…
nblumhardt Apr 22, 2019
b660b51
Make FileSink constructor changes non-breaking; fix a bug whereby a s…
nblumhardt Apr 22, 2019
b904968
Reenable an old test that was lost
nblumhardt Apr 22, 2019
b6090cc
A test for the encoding fix
nblumhardt Apr 22, 2019
34344ad
Move FileLifecycleHooks down under Serilog.Sinks.File - avoids namesp…
nblumhardt Apr 22, 2019
0ae234e
Enable hooks and encoding for auditing methods
nblumhardt Apr 22, 2019
55fcb2b
Add backwards-compatible configuration overloads
nblumhardt Apr 22, 2019
d4fa80a
Expose encoding to OnOpened() hook; switch to AppVeyor Linux builds
nblumhardt Apr 22, 2019
9f7352d
Fix Linux build script targets
nblumhardt Apr 22, 2019
ca0ac8c
Test for header writing
nblumhardt Apr 22, 2019
5b3d64a
OnOpened() -> OnFileOpened()
nblumhardt Apr 22, 2019
36381f6
Merge pull request #80 from cocowalla/feature/stream-wrapper
nblumhardt Apr 22, 2019
e420a36
Small clarification of size limiting behavior [skip ci]
nblumhardt Apr 22, 2019
9f8bfc3
Update NuGet API Key
merbla May 2, 2019
57d96c2
Add OnFileRemoving life cycle hook #106
Jul 8, 2019
4f1ae37
OnFileRemoving will not interfere with Serilog delete
Jul 10, 2019
735efa9
Update naming and summaries
Jul 12, 2019
f6d1cff
Add test
Jul 15, 2019
9a0257e
Merge pull request #107 from nogard111/OnFileRemovingHook
nblumhardt Jul 16, 2019
1213d13
compile the regex
SimonCropp Aug 24, 2019
5b52dd2
Merge pull request #111 from SimonCropp/compiledRegex
nblumhardt Aug 25, 2019
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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ insert_final_newline = true
indent_style = space
indent_size = 4

[*.{csproj,json,config,yml}]
[*.{csproj,json,config,yml,props}]
indent_size = 2

[*.sh]
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ bld/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# Rider cache/options directory
.idea

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ matrix:
- os: linux
dist: trusty
sudo: required
dotnet: 2.0.0
dotnet: 2.1.300
group: edge
script:
- ./build.sh
6 changes: 3 additions & 3 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ foreach ($src in ls src/*) {

echo "build: Packaging project in $src"

& dotnet build -c Release --version-suffix=$buildSuffix
& dotnet build -c Release --version-suffix=$buildSuffix -p:EnableSourceLink=true
if ($suffix) {
& dotnet pack -c Release --include-source -o ..\..\artifacts --version-suffix=$suffix --no-build
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix --no-build
} else {
& dotnet pack -c Release --include-source -o ..\..\artifacts --no-build
& dotnet pack -c Release -o ..\..\artifacts --no-build
}
if($LASTEXITCODE -ne 0) { exit 1 }

Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 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)
# 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)

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

### Getting started

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

```powershell
Install-Package Serilog.Sinks.File
Expand All @@ -30,16 +30,18 @@ log20180702.txt

### Limits

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.
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).

The limit can be changed or removed using the `fileSizeLimitBytes` parameter.

```csharp
.WriteTo.File("log.txt", fileSizeLimitBytes: null)
```
```

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.

```csharp
.WriteTo.RollingFile("log.txt", rollingInterval: RollingInterval.Day, retainedFileCountLimit: null)
.WriteTo.File("log.txt", rollingInterval: RollingInterval.Day, retainedFileCountLimit: null)
```

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

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:
Expand Down Expand Up @@ -154,8 +156,8 @@ The format is controlled using an _output template_, which the file configuratio
The default format above corresponds to an output template like:

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

##### JSON event formatting
Expand Down
15 changes: 11 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
version: '{build}'
skip_tags: true
image: Visual Studio 2017
image:
- Visual Studio 2017
- Ubuntu
configuration: Release
install:
- ps: mkdir -Force ".\build\" | Out-Null
build_script:
- ps: ./Build.ps1
for:
-
matrix:
only:
- image: Ubuntu
build_script:
- sh build.sh
test: off
artifacts:
- path: artifacts/Serilog.*.nupkg
deploy:
- provider: NuGet
api_key:
secure: nvZ/z+pMS91b3kG4DgfES5AcmwwGoBYQxr9kp4XiJHj25SAlgdIxFx++1N0lFH2x
secure: N59tiJECUYpip6tEn0xvdmDAEiP9SIzyLEFLpwiigm/8WhJvBNs13QxzT1/3/JW/
skip_symbols: true
on:
branch: /^(master|dev)$/
Expand Down
8 changes: 7 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/bin/bash
#!/bin/bash

set -e
dotnet --info
dotnet --list-sdks
dotnet restore

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

echo "🤖 Running tests..."
for path in test/*.Tests/*.csproj; do
dotnet test -f netcoreapp2.0 -c Release ${path}
done
1 change: 0 additions & 1 deletion serilog-sinks-file.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{E9D1B5E1-DEB9-4A04-8BAB-24EC7240ADAF}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.travis.yml = .travis.yml
appveyor.yml = appveyor.yml
Build.ps1 = Build.ps1
build.sh = build.sh
Expand Down
Loading