Skip to content

Commit 1dd9048

Browse files
authored
Merge pull request #264 from serilog/dev
Release 5.3.0
2 parents 7be4936 + 000cd34 commit 1dd9048

File tree

98 files changed

+4192
-1198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+4192
-1198
lines changed

.editorconfig

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,72 @@
11
root = true
22

33
[*]
4-
trim_trailing_whitespace = true
5-
insert_final_newline = true
6-
indent_style = space
74
indent_size = 4
5+
indent_style = space
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
88

99
[*.{csproj,json,config,yml}]
1010
indent_size = 2
1111

1212
[*.sh]
1313
end_of_line = lf
1414

15-
[*.{cmd, bat}]
15+
[*.{cmd,bat}]
1616
end_of_line = crlf
17+
18+
[*.cs]
19+
csharp_indent_case_contents = true
20+
csharp_indent_case_contents_when_block = true
21+
csharp_indent_labels = flush_left
22+
csharp_indent_switch_labels = true
23+
csharp_new_line_before_catch = true
24+
csharp_new_line_before_else = true
25+
csharp_new_line_before_finally = true
26+
csharp_new_line_before_members_in_anonymous_types = true
27+
csharp_new_line_before_members_in_object_initializers = true
28+
csharp_new_line_before_open_brace = all
29+
csharp_new_line_between_query_expression_clauses = true
30+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:error
31+
csharp_prefer_braces = true:silent
32+
csharp_prefer_simple_default_expression = true:suggestion
33+
csharp_style_deconstructed_variable_declaration = true:suggestion
34+
csharp_preserve_single_line_blocks = true
35+
csharp_preserve_single_line_statements = true
36+
csharp_space_after_cast = false
37+
csharp_space_after_colon_in_inheritance_clause = true
38+
csharp_space_after_keywords_in_control_flow_statements = true
39+
csharp_space_around_binary_operators = before_and_after
40+
csharp_space_before_colon_in_inheritance_clause = true
41+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
42+
csharp_space_between_method_call_name_and_opening_parenthesis = false
43+
csharp_space_between_method_call_parameter_list_parentheses = false
44+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
45+
csharp_space_between_method_declaration_parameter_list_parentheses = false
46+
csharp_space_between_parentheses = false
47+
csharp_style_conditional_delegate_call = true:suggestion
48+
csharp_style_expression_bodied_accessors = true:silent
49+
csharp_style_expression_bodied_constructors = false:silent
50+
csharp_style_expression_bodied_indexers = true:silent
51+
csharp_style_expression_bodied_methods = false:silent
52+
csharp_style_expression_bodied_operators = false:silent
53+
csharp_style_expression_bodied_properties = true:silent
54+
csharp_style_inlined_variable_declaration = true:suggestion
55+
csharp_style_pattern_local_over_anonymous_function = true:suggestion
56+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
57+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
58+
csharp_style_throw_expression = true:suggestion
59+
csharp_style_var_elsewhere = true:silent
60+
csharp_style_var_for_built_in_types = true:warning
61+
csharp_style_var_when_type_is_apparent = true:warning
62+
csharp_using_directive_placement = outside_namespace:warning
63+
64+
dotnet_naming_rule.private_members_with_underscore.symbols = private_fields
65+
dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore
66+
dotnet_naming_rule.private_members_with_underscore.severity = error
67+
dotnet_naming_symbols.private_fields.applicable_kinds = field
68+
dotnet_naming_symbols.private_fields.applicable_accessibilities = private,protected
69+
dotnet_naming_style.prefix_underscore.capitalization = camel_case
70+
dotnet_naming_style.prefix_underscore.required_prefix = _
71+
dotnet_sort_system_directives_first = true
72+
dotnet_style_require_accessibility_modifiers = always:error

CHANGES.md

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,58 @@
1-
5.1
1+
# 5.3.0
2+
Code quality release.
3+
* Added code analysis and editorconfig rules based on Microsoft standards.
4+
* Fixed code analysis errors where possible and added justified suppressions the few remainig.
5+
* Use Visual Studio 2019 for AppVeyor builds
6+
* Updated some dependencies.
7+
* Added CombinedConfigDemo sample program showing how to combine config and code based sink intitialization.
8+
* Added a lot of unit tests.
9+
10+
# 5.2.0
11+
* Enhancement #232: Allow to override formatter for rendering LogEvent column.
12+
* Fixed #187 (again - still an exception when using logevent column with TimeStamp column type DateTimeOffset).
13+
* Added sample programs
14+
15+
# 5.1.4
16+
* Fixed #187 Support datetimeoffset as a column type for default column TimeStamp.
17+
* Fixed #229 Slight issue with documentation.
18+
19+
# 5.1.3
20+
* Support binary data type, support specify data length in column config, support specify allow null column
21+
* Also build on unit-test commits
22+
* Added issue templase
23+
* Hybrid config implementation
24+
* Bugfixes
25+
26+
# 5.1.2
227
* Support for Audit sink added (#118/#110).
328

4-
4.0.0
29+
# 4.0.0
530
* Serilog 2.0
631
* [Documentation fix](https://github.com/serilog/serilog-sinks-mssqlserver/pull/32)
732

8-
2.0.33
33+
# 2.0.33
934
* Option added to exclude redundant properties from serialized JSON in column LogEvent. (https://github.com/serilog/serilog-sinks-mssqlserver/pull/27)
1035

11-
2.0.32
36+
# 2.0.32
1237
* Safe conversion of data types. Also included selflog for bulk operation errors. (https://github.com/serilog/serilog-sinks-mssqlserver/pull/4)
1338

14-
2.0.31
39+
# 2.0.31
1540
* Added the ability to configure additional columns via XML configuration (https://github.com/serilog/serilog-sinks-mssqlserver/pull/6)
1641

17-
2.0.30
42+
# 2.0.30
1843
* You can optionally save the log event inside the database too. Also added ability to exclude the properties if they are saved already inside additional columns. (https://github.com/serilog/serilog-sinks-mssqlserver/pull/7)
1944

20-
2.0.28
45+
# 2.0.28
2146
* Added explicit column mappings (https://github.com/serilog/serilog-sinks-mssqlserver/pull/10)
2247

23-
2.0.27
48+
# 2.0.27
2449
* Option added to automatically create a database table (by Kiran Varsani (https://github.com/varsanikp))
2550

26-
2.0.13
51+
# 2.0.13
2752
* Ability to add additional properties as columns in the database
2853

29-
2.0.1
54+
# 2.0.1
3055
* Option to [write times in UTC](https://github.com/serilog/serilog-sinks-mssqlserver/pull/1)
3156

32-
1.5
57+
# 1.5
3358
* Moved from serilog/serilog

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ A Serilog sink that writes events to Microsoft SQL Server. This sink will write
55
**Package** - [Serilog.Sinks.MSSqlServer](http://nuget.org/packages/serilog.sinks.mssqlserver)
66
| **Minimum Platforms** - .NET Framework 4.5.2, .NET Core 2.0, .NET Standard 2.0
77

8-
From version 5.1 and up, this sink also support the Audit capabilities.
98
#### Topics
109

1110
* [Sink Configuration Options](#sink-configuration-options)

appveyor.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: '{build}'
22
skip_tags: true
3-
image: Visual Studio 2017
3+
image: Visual Studio 2019
44
configuration: Release
55
install:
66
- ps: mkdir -Force ".\build\" | Out-Null
@@ -9,13 +9,6 @@ build_script:
99
test: off
1010
artifacts:
1111
- path: artifacts/Serilog.*.nupkg
12-
only_commits:
13-
files:
14-
- serilog-sinks-mssqlserver.sln
15-
- src/Serilog.Sinks.MSSqlServer/
16-
- Build.ps1
17-
- assets/
18-
- test/Serilog.Sinks.MSSqlServer.Tests/
1912
deploy:
2013
- provider: NuGet
2114
api_key:

sample/AppConfigDemo/App.config

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
</dependentAssembly>
2424
<dependentAssembly>
2525
<assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" />
26-
<bindingRedirect oldVersion="0.0.0.0-3.1.2.0" newVersion="3.1.2.0" />
26+
<bindingRedirect oldVersion="0.0.0.0-3.1.3.0" newVersion="3.1.3.0" />
27+
</dependentAssembly>
28+
<dependentAssembly>
29+
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
30+
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
2731
</dependentAssembly>
2832
</assemblyBinding>
2933
</runtime>

sample/AppConfigDemo/AppConfigDemo.csproj

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,30 @@
3333
<WarningLevel>4</WarningLevel>
3434
</PropertyGroup>
3535
<ItemGroup>
36-
<Reference Include="Microsoft.Extensions.Configuration.Abstractions, Version=3.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
37-
<HintPath>..\..\packages\Microsoft.Extensions.Configuration.Abstractions.3.1.2\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
36+
<Reference Include="Microsoft.Extensions.Configuration.Abstractions, Version=3.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
37+
<HintPath>..\..\packages\Microsoft.Extensions.Configuration.Abstractions.3.1.3\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
3838
</Reference>
39-
<Reference Include="Microsoft.Extensions.Primitives, Version=3.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
40-
<HintPath>..\..\packages\Microsoft.Extensions.Primitives.3.1.2\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll</HintPath>
39+
<Reference Include="Microsoft.Extensions.Primitives, Version=3.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
40+
<HintPath>..\..\packages\Microsoft.Extensions.Primitives.3.1.3\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll</HintPath>
4141
</Reference>
4242
<Reference Include="Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
43-
<HintPath>..\..\packages\Serilog.2.6.0\lib\net46\Serilog.dll</HintPath>
43+
<HintPath>..\..\packages\Serilog.2.9.0\lib\net46\Serilog.dll</HintPath>
4444
</Reference>
4545
<Reference Include="System" />
46-
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
47-
<HintPath>..\..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
46+
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
47+
<HintPath>..\..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
4848
</Reference>
4949
<Reference Include="System.Configuration" />
5050
<Reference Include="System.Core" />
51-
<Reference Include="System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
52-
<HintPath>..\..\packages\System.Memory.4.5.2\lib\netstandard2.0\System.Memory.dll</HintPath>
51+
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
52+
<HintPath>..\..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
5353
</Reference>
5454
<Reference Include="System.Numerics" />
55-
<Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
56-
<HintPath>..\..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
55+
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
56+
<HintPath>..\..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
5757
</Reference>
5858
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
59-
<HintPath>..\..\packages\System.Runtime.CompilerServices.Unsafe.4.7.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
59+
<HintPath>..\..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
6060
</Reference>
6161
<Reference Include="System.Xml.Linq" />
6262
<Reference Include="System.Data.DataSetExtensions" />
@@ -67,7 +67,6 @@
6767
</ItemGroup>
6868
<ItemGroup>
6969
<Compile Include="Program.cs" />
70-
<Compile Include="Properties\AssemblyInfo.cs" />
7170
</ItemGroup>
7271
<ItemGroup>
7372
<None Include="App.config" />
@@ -79,5 +78,8 @@
7978
<Name>Serilog.Sinks.MSSqlServer</Name>
8079
</ProjectReference>
8180
</ItemGroup>
81+
<ItemGroup>
82+
<Folder Include="Properties\" />
83+
</ItemGroup>
8284
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
8385
</Project>

sample/AppConfigDemo/Program.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
using Serilog;
1+
using System;
2+
using System.Threading;
3+
using Serilog;
24
using Serilog.Events;
35
using Serilog.Sinks.MSSqlServer;
4-
using System;
5-
using System.Threading;
66

77
namespace AppConfigDemo
88
{
9-
public class Program
9+
public static class Program
1010
{
11-
const string _connectionString = "Server=localhost;Database=LogTest;Integrated Security=SSPI;";
12-
const string _schemaName = "dbo";
13-
const string _tableName = "LogEvents";
11+
private const string _connectionString = "Server=localhost;Database=LogTest;Integrated Security=SSPI;";
12+
private const string _schemaName = "dbo";
13+
private const string _tableName = "LogEvents";
1414

1515
public static void Main()
1616
{

sample/AppConfigDemo/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

sample/AppConfigDemo/packages.config

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Microsoft.Extensions.Configuration.Abstractions" version="3.1.2" targetFramework="net461" />
4-
<package id="Microsoft.Extensions.Primitives" version="3.1.2" targetFramework="net461" />
5-
<package id="Serilog" version="2.6.0" targetFramework="net461" />
3+
<package id="Microsoft.Extensions.Configuration.Abstractions" version="3.1.3" targetFramework="net461" />
4+
<package id="Microsoft.Extensions.Primitives" version="3.1.3" targetFramework="net461" />
5+
<package id="Serilog" version="2.9.0" targetFramework="net461" />
66
<package id="Serilog.Settings.AppSettings" version="2.2.2" targetFramework="net461" />
7-
<package id="System.Buffers" version="4.4.0" targetFramework="net461" />
8-
<package id="System.Memory" version="4.5.2" targetFramework="net461" />
9-
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net461" />
10-
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.0" targetFramework="net461" />
7+
<package id="System.Buffers" version="4.5.1" targetFramework="net461" />
8+
<package id="System.Memory" version="4.5.4" targetFramework="net461" />
9+
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" />
10+
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net461" />
1111
</packages>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<Content Include="appsettings.json">
10+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
11+
</Content>
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.3" />
16+
</ItemGroup>
17+
18+
<ItemGroup>
19+
<ProjectReference Include="..\..\src\Serilog.Sinks.MSSqlServer\Serilog.Sinks.MSSqlServer.csproj" />
20+
</ItemGroup>
21+
22+
</Project>

0 commit comments

Comments
 (0)