diff --git a/Serilog-net40.sln b/Serilog-net40.sln
deleted file mode 100644
index 3f67c8365..000000000
--- a/Serilog-net40.sln
+++ /dev/null
@@ -1,34 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.31101.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog-net40", "src\Serilog\Serilog-net40.csproj", "{0915DBD9-0F7C-4439-8D9E-74C3D579B219}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.FullNetFx-net40", "src\Serilog.FullNetFx\Serilog.FullNetFx-net40.csproj", "{7A9E1095-167D-402A-B43D-B36B97FF183D}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Tests-net40", "test\Serilog.Tests\Serilog.Tests-net40.csproj", "{D5648551-D19D-41E3-9FC1-E74B111EEF41}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Release|Any CPU.Build.0 = Release|Any CPU
- {7A9E1095-167D-402A-B43D-B36B97FF183D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7A9E1095-167D-402A-B43D-B36B97FF183D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7A9E1095-167D-402A-B43D-B36B97FF183D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7A9E1095-167D-402A-B43D-B36B97FF183D}.Release|Any CPU.Build.0 = Release|Any CPU
- {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Serilog-vs2015.sln b/Serilog-vs2015.sln
deleted file mode 100644
index 62bd64a4c..000000000
--- a/Serilog-vs2015.sln
+++ /dev/null
@@ -1,318 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.22310.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{037440DE-440B-4129-9F7A-09B42D00397E}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{0D135C0C-A60B-454A-A2F4-CD74A30E04B0}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{E9D1B5E1-DEB9-4A04-8BAB-24EC7240ADAF}"
- ProjectSection(SolutionItems) = preProject
- README.md = README.md
- assets\Serilog.snk = assets\Serilog.snk
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog", "src\Serilog\Serilog.csproj", "{0915DBD9-0F7C-4439-8D9E-74C3D579B219}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Tests", "test\Serilog.Tests\Serilog.Tests.csproj", "{D5648551-D19D-41E3-9FC1-E74B111EEF41}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.CouchDB", "src\Serilog.Sinks.CouchDB\Serilog.Sinks.CouchDB.csproj", "{E728D183-07C4-49F7-8C4C-D76D70C8F3B4}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.MongoDB", "src\Serilog.Sinks.MongoDB\Serilog.Sinks.MongoDB.csproj", "{8164BDE4-48FE-4A81-B33E-FEE348904BB8}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.FullNetFx", "src\Serilog.FullNetFx\Serilog.FullNetFx.csproj", "{7A9E1095-167D-402A-B43D-B36B97FF183D}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.AzureTableStorage", "src\Serilog.Sinks.AzureTableStorage\Serilog.Sinks.AzureTableStorage.csproj", "{DA0432BD-FDA0-40C9-BCF1-A38F601600D3}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.RavenDB", "src\Serilog.Sinks.RavenDB\Serilog.Sinks.RavenDB.csproj", "{EEDEA9EA-7742-4EDF-A848-B6199D1030F7}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.RavenDB.Tests", "test\Serilog.Sinks.RavenDB.Tests\Serilog.Sinks.RavenDB.Tests.csproj", "{CE37740B-0B12-4974-BE44-A64E85C9ED9D}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.PerformanceTests", "test\Serilog.PerformanceTests\Serilog.PerformanceTests.csproj", "{6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Log4Net", "src\Serilog.Sinks.Log4Net\Serilog.Sinks.Log4Net.csproj", "{83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Glimpse", "src\Serilog.Sinks.Glimpse\Serilog.Sinks.Glimpse.csproj", "{48E6827A-6878-4764-A957-7542891E7F5B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Extras.Topshelf", "src\Serilog.Extras.TopShelf\Serilog.Extras.Topshelf.csproj", "{1C0FE823-FCCB-46B4-B76C-9661295A312A}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Extras.Web", "src\Serilog.Extras.Web\Serilog.Extras.Web.csproj", "{13CEC8DD-6087-4FEE-AEC1-0511B8959CCD}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.SignalR", "src\Serilog.Sinks.SignalR\Serilog.Sinks.SignalR.csproj", "{0D51B456-A1B0-4048-9E90-E98CEB95E976}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Email", "src\Serilog.Sinks.Email\Serilog.Sinks.Email.csproj", "{F3B80F77-155C-434D-9865-2E522D072972}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.EventLog", "src\Serilog.Sinks.EventLog\Serilog.Sinks.EventLog.csproj", "{EEA8B8EB-0FE6-44C2-9D10-02B7E3DEAD06}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.ElmahIO", "src\Serilog.Sinks.ElmahIO\Serilog.Sinks.ElmahIO.csproj", "{830BBD7E-6068-4D97-B6BF-59051FC2B6B1}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Loggr", "src\Serilog.Sinks.Loggr\Serilog.Sinks.Loggr.csproj", "{C51F89BC-9DC1-4A13-98E2-A2ED09FD9F0D}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.ElasticSearch", "src\Serilog.Sinks.ElasticSearch\Serilog.Sinks.ElasticSearch.csproj", "{E12881F7-B522-4E42-BCCC-4A81F42F8D8B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Loggly", "src\Serilog.Sinks.Loggly\Serilog.Sinks.Loggly.csproj", "{E3264D8A-63D7-40AB-B67B-BF55E53DC9C4}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Extras.Timing", "src\Serilog.Extras.Timing\Serilog.Extras.Timing.csproj", "{264C91AF-6631-4E04-A2AC-E32E88055228}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Extras.AppSettings", "src\Serilog.Extras.AppSettings\Serilog.Extras.AppSettings.csproj", "{21CAF132-BBAB-41FD-A018-EB9AE54822ED}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Logentries", "src\Serilog.Sinks.Logentries\Serilog.Sinks.Logentries.csproj", "{7C03FE5B-426F-494C-9B7E-B23F060AB5D3}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Couchbase", "src\Serilog.Sinks.Couchbase\Serilog.Sinks.Couchbase.csproj", "{104D5B1E-47BE-4739-A183-08C35BF4D38D}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Extras.MSOwin", "src\Serilog.Extras.MSOwin\Serilog.Extras.MSOwin.csproj", "{FDCEBC10-F403-4DDD-8594-DE6D7DD543AF}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Extras.MSOwin.Tests", "test\Serilog.Extras.MSOwin.Tests\Serilog.Extras.MSOwin.Tests.csproj", "{4F81EDAE-2E06-4024-925A-E495C852BDCF}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.MSSqlServer", "src\Serilog.Sinks.MSSqlServer\Serilog.Sinks.MSSqlServer.csproj", "{31C64BE9-4EF6-42D5-A811-D7D24613EEF6}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Raygun", "src\Serilog.Sinks.Raygun\Serilog.Sinks.Raygun.csproj", "{B4EEC1AD-6E2B-49F6-A4C0-A9D39E9C4EFA}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.NLog", "src\Serilog.Sinks.NLog\Serilog.Sinks.NLog.csproj", "{9A3994D6-4CE1-4AF9-A43D-2AF324075B21}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.SmokeTest", "test\Serilog.SmokeTest\Serilog.SmokeTest.csproj", "{58563C46-B781-4799-ABD5-9745F94478FD}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.ApplicationInsights", "src\Serilog.Sinks.ApplicationInsights\Serilog.Sinks.ApplicationInsights.csproj", "{3F08FA19-8D51-427D-8CDA-965CF79B9ECF}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Extras.AppSettings.Tests", "test\Serilog.Extras.AppSettings.Tests\Serilog.Extras.AppSettings.Tests.csproj", "{67398D2A-0829-4373-ABC5-2161FEB28A05}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Extras.Attributed", "src\Serilog.Extras.Attributed\Serilog.Extras.Attributed.csproj", "{A79F906E-0298-49DC-93EC-CE4F1F5D13E2}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Extras.Attributed.Tests", "test\Serilog.Extras.Attributed.Tests\Serilog.Extras.Attributed.Tests.csproj", "{182ECDA3-A97D-4BB6-BC6F-60A137478B92}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Extras.DestructureByIgnoring", "src\Serilog.Extras.DestructureByIgnoring\Serilog.Extras.DestructureByIgnoring.csproj", "{C5CC62F4-310F-495C-96EA-B8E5D26F8D57}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Extras.DestructureByIgnoring.Tests", "test\Serilog.Extras.DestructureByIgnoring.Tests\Serilog.Extras.DestructureByIgnoring.Tests.csproj", "{977E42C3-D501-4730-98FF-525B753B1E3A}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Seq", "src\Serilog.Sinks.Seq\Serilog.Sinks.Seq.csproj", "{B6A720E1-732B-4B8B-868B-5914AF85983C}"
-EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog-aspnetcore50", "src\Serilog\Serilog-aspnetcore50.kproj", "{3892F3AE-4E82-4134-B4ED-2B28E5B82451}"
-EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.FullNetFx-aspnetcore50", "src\Serilog.FullNetFx\Serilog.FullNetFx-aspnetcore50.kproj", "{370C3957-E1F5-4818-B391-8DCA083D7A9F}"
-EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.aspnetcore50.SmokeTest", "test\Serilog.SmokeTest\Serilog.aspnetcore50.SmokeTest.kproj", "{CE11BE0D-F4F8-4D34-AC74-F7E9AB344EC3}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Release|Any CPU.Build.0 = Release|Any CPU
- {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Release|Any CPU.Build.0 = Release|Any CPU
- {E728D183-07C4-49F7-8C4C-D76D70C8F3B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E728D183-07C4-49F7-8C4C-D76D70C8F3B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E728D183-07C4-49F7-8C4C-D76D70C8F3B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E728D183-07C4-49F7-8C4C-D76D70C8F3B4}.Release|Any CPU.Build.0 = Release|Any CPU
- {8164BDE4-48FE-4A81-B33E-FEE348904BB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8164BDE4-48FE-4A81-B33E-FEE348904BB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8164BDE4-48FE-4A81-B33E-FEE348904BB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8164BDE4-48FE-4A81-B33E-FEE348904BB8}.Release|Any CPU.Build.0 = Release|Any CPU
- {7A9E1095-167D-402A-B43D-B36B97FF183D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7A9E1095-167D-402A-B43D-B36B97FF183D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7A9E1095-167D-402A-B43D-B36B97FF183D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7A9E1095-167D-402A-B43D-B36B97FF183D}.Release|Any CPU.Build.0 = Release|Any CPU
- {DA0432BD-FDA0-40C9-BCF1-A38F601600D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DA0432BD-FDA0-40C9-BCF1-A38F601600D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DA0432BD-FDA0-40C9-BCF1-A38F601600D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DA0432BD-FDA0-40C9-BCF1-A38F601600D3}.Release|Any CPU.Build.0 = Release|Any CPU
- {EEDEA9EA-7742-4EDF-A848-B6199D1030F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EEDEA9EA-7742-4EDF-A848-B6199D1030F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EEDEA9EA-7742-4EDF-A848-B6199D1030F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EEDEA9EA-7742-4EDF-A848-B6199D1030F7}.Release|Any CPU.Build.0 = Release|Any CPU
- {CE37740B-0B12-4974-BE44-A64E85C9ED9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CE37740B-0B12-4974-BE44-A64E85C9ED9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CE37740B-0B12-4974-BE44-A64E85C9ED9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {CE37740B-0B12-4974-BE44-A64E85C9ED9D}.Release|Any CPU.Build.0 = Release|Any CPU
- {6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A}.Release|Any CPU.Build.0 = Release|Any CPU
- {83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0}.Release|Any CPU.Build.0 = Release|Any CPU
- {48E6827A-6878-4764-A957-7542891E7F5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {48E6827A-6878-4764-A957-7542891E7F5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {48E6827A-6878-4764-A957-7542891E7F5B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {48E6827A-6878-4764-A957-7542891E7F5B}.Release|Any CPU.Build.0 = Release|Any CPU
- {1C0FE823-FCCB-46B4-B76C-9661295A312A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1C0FE823-FCCB-46B4-B76C-9661295A312A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1C0FE823-FCCB-46B4-B76C-9661295A312A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1C0FE823-FCCB-46B4-B76C-9661295A312A}.Release|Any CPU.Build.0 = Release|Any CPU
- {13CEC8DD-6087-4FEE-AEC1-0511B8959CCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {13CEC8DD-6087-4FEE-AEC1-0511B8959CCD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {13CEC8DD-6087-4FEE-AEC1-0511B8959CCD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {13CEC8DD-6087-4FEE-AEC1-0511B8959CCD}.Release|Any CPU.Build.0 = Release|Any CPU
- {0D51B456-A1B0-4048-9E90-E98CEB95E976}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0D51B456-A1B0-4048-9E90-E98CEB95E976}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0D51B456-A1B0-4048-9E90-E98CEB95E976}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0D51B456-A1B0-4048-9E90-E98CEB95E976}.Release|Any CPU.Build.0 = Release|Any CPU
- {F3B80F77-155C-434D-9865-2E522D072972}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F3B80F77-155C-434D-9865-2E522D072972}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F3B80F77-155C-434D-9865-2E522D072972}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F3B80F77-155C-434D-9865-2E522D072972}.Release|Any CPU.Build.0 = Release|Any CPU
- {EEA8B8EB-0FE6-44C2-9D10-02B7E3DEAD06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EEA8B8EB-0FE6-44C2-9D10-02B7E3DEAD06}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EEA8B8EB-0FE6-44C2-9D10-02B7E3DEAD06}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EEA8B8EB-0FE6-44C2-9D10-02B7E3DEAD06}.Release|Any CPU.Build.0 = Release|Any CPU
- {830BBD7E-6068-4D97-B6BF-59051FC2B6B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {830BBD7E-6068-4D97-B6BF-59051FC2B6B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {830BBD7E-6068-4D97-B6BF-59051FC2B6B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {830BBD7E-6068-4D97-B6BF-59051FC2B6B1}.Release|Any CPU.Build.0 = Release|Any CPU
- {C51F89BC-9DC1-4A13-98E2-A2ED09FD9F0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C51F89BC-9DC1-4A13-98E2-A2ED09FD9F0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C51F89BC-9DC1-4A13-98E2-A2ED09FD9F0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C51F89BC-9DC1-4A13-98E2-A2ED09FD9F0D}.Release|Any CPU.Build.0 = Release|Any CPU
- {E12881F7-B522-4E42-BCCC-4A81F42F8D8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E12881F7-B522-4E42-BCCC-4A81F42F8D8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E12881F7-B522-4E42-BCCC-4A81F42F8D8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E12881F7-B522-4E42-BCCC-4A81F42F8D8B}.Release|Any CPU.Build.0 = Release|Any CPU
- {E3264D8A-63D7-40AB-B67B-BF55E53DC9C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E3264D8A-63D7-40AB-B67B-BF55E53DC9C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E3264D8A-63D7-40AB-B67B-BF55E53DC9C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E3264D8A-63D7-40AB-B67B-BF55E53DC9C4}.Release|Any CPU.Build.0 = Release|Any CPU
- {264C91AF-6631-4E04-A2AC-E32E88055228}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {264C91AF-6631-4E04-A2AC-E32E88055228}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {264C91AF-6631-4E04-A2AC-E32E88055228}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {264C91AF-6631-4E04-A2AC-E32E88055228}.Release|Any CPU.Build.0 = Release|Any CPU
- {21CAF132-BBAB-41FD-A018-EB9AE54822ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {21CAF132-BBAB-41FD-A018-EB9AE54822ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {21CAF132-BBAB-41FD-A018-EB9AE54822ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {21CAF132-BBAB-41FD-A018-EB9AE54822ED}.Release|Any CPU.Build.0 = Release|Any CPU
- {7C03FE5B-426F-494C-9B7E-B23F060AB5D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7C03FE5B-426F-494C-9B7E-B23F060AB5D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7C03FE5B-426F-494C-9B7E-B23F060AB5D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7C03FE5B-426F-494C-9B7E-B23F060AB5D3}.Release|Any CPU.Build.0 = Release|Any CPU
- {104D5B1E-47BE-4739-A183-08C35BF4D38D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {104D5B1E-47BE-4739-A183-08C35BF4D38D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {104D5B1E-47BE-4739-A183-08C35BF4D38D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {104D5B1E-47BE-4739-A183-08C35BF4D38D}.Release|Any CPU.Build.0 = Release|Any CPU
- {FDCEBC10-F403-4DDD-8594-DE6D7DD543AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {FDCEBC10-F403-4DDD-8594-DE6D7DD543AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {FDCEBC10-F403-4DDD-8594-DE6D7DD543AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {FDCEBC10-F403-4DDD-8594-DE6D7DD543AF}.Release|Any CPU.Build.0 = Release|Any CPU
- {4F81EDAE-2E06-4024-925A-E495C852BDCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4F81EDAE-2E06-4024-925A-E495C852BDCF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4F81EDAE-2E06-4024-925A-E495C852BDCF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4F81EDAE-2E06-4024-925A-E495C852BDCF}.Release|Any CPU.Build.0 = Release|Any CPU
- {31C64BE9-4EF6-42D5-A811-D7D24613EEF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {31C64BE9-4EF6-42D5-A811-D7D24613EEF6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {31C64BE9-4EF6-42D5-A811-D7D24613EEF6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {31C64BE9-4EF6-42D5-A811-D7D24613EEF6}.Release|Any CPU.Build.0 = Release|Any CPU
- {B4EEC1AD-6E2B-49F6-A4C0-A9D39E9C4EFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B4EEC1AD-6E2B-49F6-A4C0-A9D39E9C4EFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B4EEC1AD-6E2B-49F6-A4C0-A9D39E9C4EFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B4EEC1AD-6E2B-49F6-A4C0-A9D39E9C4EFA}.Release|Any CPU.Build.0 = Release|Any CPU
- {9A3994D6-4CE1-4AF9-A43D-2AF324075B21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {9A3994D6-4CE1-4AF9-A43D-2AF324075B21}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9A3994D6-4CE1-4AF9-A43D-2AF324075B21}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {9A3994D6-4CE1-4AF9-A43D-2AF324075B21}.Release|Any CPU.Build.0 = Release|Any CPU
- {58563C46-B781-4799-ABD5-9745F94478FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {58563C46-B781-4799-ABD5-9745F94478FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {58563C46-B781-4799-ABD5-9745F94478FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {58563C46-B781-4799-ABD5-9745F94478FD}.Release|Any CPU.Build.0 = Release|Any CPU
- {3F08FA19-8D51-427D-8CDA-965CF79B9ECF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3F08FA19-8D51-427D-8CDA-965CF79B9ECF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3F08FA19-8D51-427D-8CDA-965CF79B9ECF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3F08FA19-8D51-427D-8CDA-965CF79B9ECF}.Release|Any CPU.Build.0 = Release|Any CPU
- {67398D2A-0829-4373-ABC5-2161FEB28A05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {67398D2A-0829-4373-ABC5-2161FEB28A05}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {67398D2A-0829-4373-ABC5-2161FEB28A05}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {67398D2A-0829-4373-ABC5-2161FEB28A05}.Release|Any CPU.Build.0 = Release|Any CPU
- {A79F906E-0298-49DC-93EC-CE4F1F5D13E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A79F906E-0298-49DC-93EC-CE4F1F5D13E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A79F906E-0298-49DC-93EC-CE4F1F5D13E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A79F906E-0298-49DC-93EC-CE4F1F5D13E2}.Release|Any CPU.Build.0 = Release|Any CPU
- {182ECDA3-A97D-4BB6-BC6F-60A137478B92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {182ECDA3-A97D-4BB6-BC6F-60A137478B92}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {182ECDA3-A97D-4BB6-BC6F-60A137478B92}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {182ECDA3-A97D-4BB6-BC6F-60A137478B92}.Release|Any CPU.Build.0 = Release|Any CPU
- {C5CC62F4-310F-495C-96EA-B8E5D26F8D57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C5CC62F4-310F-495C-96EA-B8E5D26F8D57}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C5CC62F4-310F-495C-96EA-B8E5D26F8D57}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C5CC62F4-310F-495C-96EA-B8E5D26F8D57}.Release|Any CPU.Build.0 = Release|Any CPU
- {13771374-CF5A-4955-BCDB-EBEFE70944B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {13771374-CF5A-4955-BCDB-EBEFE70944B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {13771374-CF5A-4955-BCDB-EBEFE70944B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {13771374-CF5A-4955-BCDB-EBEFE70944B8}.Release|Any CPU.Build.0 = Release|Any CPU
- {977E42C3-D501-4730-98FF-525B753B1E3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {977E42C3-D501-4730-98FF-525B753B1E3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {977E42C3-D501-4730-98FF-525B753B1E3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {977E42C3-D501-4730-98FF-525B753B1E3A}.Release|Any CPU.Build.0 = Release|Any CPU
- {17DEED0F-F9CB-48FB-B4DC-53FB6AEE64D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {17DEED0F-F9CB-48FB-B4DC-53FB6AEE64D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {17DEED0F-F9CB-48FB-B4DC-53FB6AEE64D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {17DEED0F-F9CB-48FB-B4DC-53FB6AEE64D7}.Release|Any CPU.Build.0 = Release|Any CPU
- {B6A720E1-732B-4B8B-868B-5914AF85983C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B6A720E1-732B-4B8B-868B-5914AF85983C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B6A720E1-732B-4B8B-868B-5914AF85983C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B6A720E1-732B-4B8B-868B-5914AF85983C}.Release|Any CPU.Build.0 = Release|Any CPU
- {3892F3AE-4E82-4134-B4ED-2B28E5B82451}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3892F3AE-4E82-4134-B4ED-2B28E5B82451}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3892F3AE-4E82-4134-B4ED-2B28E5B82451}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3892F3AE-4E82-4134-B4ED-2B28E5B82451}.Release|Any CPU.Build.0 = Release|Any CPU
- {370C3957-E1F5-4818-B391-8DCA083D7A9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {370C3957-E1F5-4818-B391-8DCA083D7A9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {370C3957-E1F5-4818-B391-8DCA083D7A9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {370C3957-E1F5-4818-B391-8DCA083D7A9F}.Release|Any CPU.Build.0 = Release|Any CPU
- {CE11BE0D-F4F8-4D34-AC74-F7E9AB344EC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CE11BE0D-F4F8-4D34-AC74-F7E9AB344EC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CE11BE0D-F4F8-4D34-AC74-F7E9AB344EC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {CE11BE0D-F4F8-4D34-AC74-F7E9AB344EC3}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {0915DBD9-0F7C-4439-8D9E-74C3D579B219} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {D5648551-D19D-41E3-9FC1-E74B111EEF41} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0}
- {E728D183-07C4-49F7-8C4C-D76D70C8F3B4} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {8164BDE4-48FE-4A81-B33E-FEE348904BB8} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {7A9E1095-167D-402A-B43D-B36B97FF183D} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {DA0432BD-FDA0-40C9-BCF1-A38F601600D3} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {EEDEA9EA-7742-4EDF-A848-B6199D1030F7} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {CE37740B-0B12-4974-BE44-A64E85C9ED9D} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0}
- {6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0}
- {83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {48E6827A-6878-4764-A957-7542891E7F5B} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {1C0FE823-FCCB-46B4-B76C-9661295A312A} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {13CEC8DD-6087-4FEE-AEC1-0511B8959CCD} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {0D51B456-A1B0-4048-9E90-E98CEB95E976} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {F3B80F77-155C-434D-9865-2E522D072972} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {EEA8B8EB-0FE6-44C2-9D10-02B7E3DEAD06} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {830BBD7E-6068-4D97-B6BF-59051FC2B6B1} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {C51F89BC-9DC1-4A13-98E2-A2ED09FD9F0D} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {E12881F7-B522-4E42-BCCC-4A81F42F8D8B} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {E3264D8A-63D7-40AB-B67B-BF55E53DC9C4} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {264C91AF-6631-4E04-A2AC-E32E88055228} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {21CAF132-BBAB-41FD-A018-EB9AE54822ED} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {7C03FE5B-426F-494C-9B7E-B23F060AB5D3} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {104D5B1E-47BE-4739-A183-08C35BF4D38D} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {FDCEBC10-F403-4DDD-8594-DE6D7DD543AF} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {4F81EDAE-2E06-4024-925A-E495C852BDCF} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0}
- {31C64BE9-4EF6-42D5-A811-D7D24613EEF6} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {B4EEC1AD-6E2B-49F6-A4C0-A9D39E9C4EFA} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {9A3994D6-4CE1-4AF9-A43D-2AF324075B21} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {58563C46-B781-4799-ABD5-9745F94478FD} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0}
- {3F08FA19-8D51-427D-8CDA-965CF79B9ECF} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {67398D2A-0829-4373-ABC5-2161FEB28A05} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0}
- {A79F906E-0298-49DC-93EC-CE4F1F5D13E2} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {182ECDA3-A97D-4BB6-BC6F-60A137478B92} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0}
- {C5CC62F4-310F-495C-96EA-B8E5D26F8D57} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {13771374-CF5A-4955-BCDB-EBEFE70944B8} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {977E42C3-D501-4730-98FF-525B753B1E3A} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0}
- {17DEED0F-F9CB-48FB-B4DC-53FB6AEE64D7} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {B6A720E1-732B-4B8B-868B-5914AF85983C} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {3892F3AE-4E82-4134-B4ED-2B28E5B82451} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {370C3957-E1F5-4818-B391-8DCA083D7A9F} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {CE11BE0D-F4F8-4D34-AC74-F7E9AB344EC3} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0}
- EndGlobalSection
-EndGlobal
diff --git a/Serilog.sln b/Serilog.sln
index 5da528f9e..9b0df01f5 100644
--- a/Serilog.sln
+++ b/Serilog.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.31101.0
+# Visual Studio 14
+VisualStudioVersion = 14.0.22823.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{037440DE-440B-4129-9F7A-09B42D00397E}"
EndProject
@@ -16,17 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{E9D1B5
assets\Serilog.snk = assets\Serilog.snk
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog", "src\Serilog\Serilog.csproj", "{0915DBD9-0F7C-4439-8D9E-74C3D579B219}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Tests", "test\Serilog.Tests\Serilog.Tests.csproj", "{D5648551-D19D-41E3-9FC1-E74B111EEF41}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.FullNetFx", "src\Serilog.FullNetFx\Serilog.FullNetFx.csproj", "{7A9E1095-167D-402A-B43D-B36B97FF183D}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.PerformanceTests", "test\Serilog.PerformanceTests\Serilog.PerformanceTests.csproj", "{6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.SmokeTest", "test\Serilog.SmokeTest\Serilog.SmokeTest.csproj", "{58563C46-B781-4799-ABD5-9745F94478FD}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.MsTests", "test\Serilog.MsTests\Serilog.MsTests.csproj", "{7FC9FC46-5014-4461-A448-815E6CCE21E5}"
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog", "src\Serilog\Serilog.xproj", "{803CD13A-D54B-4CEC-A55F-E22AE3D93B3C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -34,40 +24,15 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Release|Any CPU.Build.0 = Release|Any CPU
- {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Release|Any CPU.Build.0 = Release|Any CPU
- {7A9E1095-167D-402A-B43D-B36B97FF183D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7A9E1095-167D-402A-B43D-B36B97FF183D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7A9E1095-167D-402A-B43D-B36B97FF183D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7A9E1095-167D-402A-B43D-B36B97FF183D}.Release|Any CPU.Build.0 = Release|Any CPU
- {6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A}.Release|Any CPU.Build.0 = Release|Any CPU
- {58563C46-B781-4799-ABD5-9745F94478FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {58563C46-B781-4799-ABD5-9745F94478FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {58563C46-B781-4799-ABD5-9745F94478FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {58563C46-B781-4799-ABD5-9745F94478FD}.Release|Any CPU.Build.0 = Release|Any CPU
- {7FC9FC46-5014-4461-A448-815E6CCE21E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7FC9FC46-5014-4461-A448-815E6CCE21E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7FC9FC46-5014-4461-A448-815E6CCE21E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7FC9FC46-5014-4461-A448-815E6CCE21E5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {803CD13A-D54B-4CEC-A55F-E22AE3D93B3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {803CD13A-D54B-4CEC-A55F-E22AE3D93B3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {803CD13A-D54B-4CEC-A55F-E22AE3D93B3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {803CD13A-D54B-4CEC-A55F-E22AE3D93B3C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {0915DBD9-0F7C-4439-8D9E-74C3D579B219} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {D5648551-D19D-41E3-9FC1-E74B111EEF41} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0}
- {7A9E1095-167D-402A-B43D-B36B97FF183D} = {037440DE-440B-4129-9F7A-09B42D00397E}
- {6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0}
- {58563C46-B781-4799-ABD5-9745F94478FD} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0}
- {7FC9FC46-5014-4461-A448-815E6CCE21E5} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0}
+ {803CD13A-D54B-4CEC-A55F-E22AE3D93B3C} = {037440DE-440B-4129-9F7A-09B42D00397E}
EndGlobalSection
EndGlobal
diff --git a/global.json b/global.json
index 96b6dc2b8..58bb789b2 100644
--- a/global.json
+++ b/global.json
@@ -1,4 +1,6 @@
{
- "sources": ["src"]
+ "projects": [ "src", "test" ],
+ "sdk": {
+ "version": "1.0.0-beta5"
+ }
}
-
diff --git a/src/Serilog.FullNetFx/LoggerConfigurationFullNetFxExtensions-net40.cs b/src/Serilog.FullNetFx/LoggerConfigurationFullNetFxExtensions-net40.cs
deleted file mode 100644
index e6774366a..000000000
--- a/src/Serilog.FullNetFx/LoggerConfigurationFullNetFxExtensions-net40.cs
+++ /dev/null
@@ -1,279 +0,0 @@
-// Copyright 2014 Serilog Contributors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using System;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Threading;
-using Serilog.Configuration;
-using Serilog.Debugging;
-using Serilog.Enrichers;
-using Serilog.Events;
-using Serilog.Formatting.Display;
-using Serilog.Formatting.Raw;
-using Serilog.Settings.AppSettings;
-using Serilog.Sinks.DiagnosticTrace;
-using Serilog.Sinks.IOFile;
-using Serilog.Sinks.RollingFile;
-using Serilog.Sinks.SystemConsole;
-
-namespace Serilog
-{
- ///
- /// Extends to add Full .NET Framework
- /// capabilities.
- ///
- public static class LoggerConfigurationFullNetFxExtensions
- {
- const string DefaultOutputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] {Message}{NewLine}{Exception}";
- const string DefaultConsoleOutputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level}] {Message}{NewLine}{Exception}";
- const long DefaultFileSizeLimitBytes = 1L * 1024 * 1024 * 1024;
- const int DefaultRetainedFileCountLimit = 31; // A long month of logs
-
- ///
- /// Writes log events to .
- ///
- /// Logger sink configuration.
- /// The minimum level for
- /// events passed through the sink.
- /// A message template describing the format used to write to the sink.
- /// the default is "{Timestamp} [{Level}] {Message}{NewLine}{Exception}".
- /// Supplies culture-specific formatting information, or null.
- /// Configuration object allowing method chaining.
- public static LoggerConfiguration Console(
- this LoggerSinkConfiguration sinkConfiguration,
- LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
- string outputTemplate = DefaultConsoleOutputTemplate,
- IFormatProvider formatProvider = null)
- {
- if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration");
- if (outputTemplate == null) throw new ArgumentNullException("outputTemplate");
- var formatter = new MessageTemplateTextFormatter(outputTemplate, formatProvider);
- return sinkConfiguration.Sink(new ConsoleSink(formatter), restrictedToMinimumLevel);
- }
-
- ///
- /// Writes log events to , using color to differentiate
- /// between levels.
- ///
- /// Logger sink configuration.
- /// The minimum level for
- /// events passed through the sink.
- /// A message template describing the format used to write to the sink.
- /// the default is "{Timestamp} [{Level}] {Message}{NewLine}{Exception}".
- /// Supplies culture-specific formatting information, or null.
- /// Configuration object allowing method chaining.
- public static LoggerConfiguration ColoredConsole(
- this LoggerSinkConfiguration sinkConfiguration,
- LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
- string outputTemplate = DefaultConsoleOutputTemplate,
- IFormatProvider formatProvider = null)
- {
- if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration");
- if (outputTemplate == null) throw new ArgumentNullException("outputTemplate");
- return sinkConfiguration.Sink(new ColoredConsoleSink(outputTemplate, formatProvider), restrictedToMinimumLevel);
- }
-
- ///
- /// Write log events in a simple text dump format to the specified file.
- ///
- /// Logger sink configuration.
- /// Path to the dump file.
- /// The minimum level for
- /// events passed through the sink.
- /// Configuration object allowing method chaining.
- [Obsolete("Please use WriteTo.Sink(new FileSink(path, new RawFormatter(), null)) instead", true), EditorBrowsable(EditorBrowsableState.Never)]
- public static LoggerConfiguration DumpFile(
- this LoggerSinkConfiguration sinkConfiguration,
- string path,
- LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum)
- {
- if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration");
- if (path == null) throw new ArgumentNullException("path");
- return sinkConfiguration.Sink(new FileSink(path, new RawFormatter(), null), restrictedToMinimumLevel);
- }
-
- ///
- /// Write log events to the specified file.
- ///
- /// Logger sink configuration.
- /// Path to the file.
- /// The minimum level for
- /// events passed through the sink.
- /// Supplies culture-specific formatting information, or null.
- /// A message template describing the format used to write to the sink.
- /// the default is "{Timestamp} [{Level}] {Message}{NewLine}{Exception}".
- /// The maximum size, in bytes, to which a log file will be allowed to grow.
- /// For unrestricted growth, pass null. The default is 1 GB.
- /// Configuration object allowing method chaining.
- /// The file will be written using the UTF-8 character set.
- public static LoggerConfiguration File(
- this LoggerSinkConfiguration sinkConfiguration,
- string path,
- LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
- string outputTemplate = DefaultOutputTemplate,
- IFormatProvider formatProvider = null,
- long? fileSizeLimitBytes = DefaultFileSizeLimitBytes)
- {
- if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration");
- if (outputTemplate == null) throw new ArgumentNullException("outputTemplate");
- var formatter = new MessageTemplateTextFormatter(outputTemplate, formatProvider);
-
- FileSink sink;
- try
- {
- sink = new FileSink(path, formatter, fileSizeLimitBytes);
- }
- catch (ArgumentException)
- {
- throw;
- }
- catch (Exception ex)
- {
- SelfLog.WriteLine("Unable to open file sink for {0}: {1}", path, ex);
- return sinkConfiguration.Sink(new NullSink());
- }
-
- return sinkConfiguration.Sink(sink, restrictedToMinimumLevel);
- }
-
- ///
- /// Write log events to a series of files. Each file will be named according to
- /// the date of the first log entry written to it. Only simple date-based rolling is
- /// currently supported.
- ///
- /// Logger sink configuration.
- /// String describing the location of the log files,
- /// with {Date} in the place of the file date. E.g. "Logs\myapp-{Date}.log" will result in log
- /// files such as "Logs\myapp-2013-10-20.log", "Logs\myapp-2013-10-21.log" and so on.
- /// The minimum level for
- /// events passed through the sink.
- /// A message template describing the format used to write to the sink.
- /// the default is "{Timestamp} [{Level}] {Message}{NewLine}{Exception}".
- /// Supplies culture-specific formatting information, or null.
- /// The maximum size, in bytes, to which any single log file will be allowed to grow.
- /// For unrestricted growth, pass null. The default is 1 GB.
- /// The maximum number of log files that will be retained,
- /// including the current log file. For unlimited retention, pass null. The default is 31.
- /// Configuration object allowing method chaining.
- /// The file will be written using the UTF-8 character set.
- public static LoggerConfiguration RollingFile(
- this LoggerSinkConfiguration sinkConfiguration,
- string pathFormat,
- LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
- string outputTemplate = DefaultOutputTemplate,
- IFormatProvider formatProvider = null,
- long? fileSizeLimitBytes = DefaultFileSizeLimitBytes,
- int? retainedFileCountLimit = DefaultRetainedFileCountLimit)
- {
- if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration");
- if (outputTemplate == null) throw new ArgumentNullException("outputTemplate");
- var formatter = new MessageTemplateTextFormatter(outputTemplate, formatProvider);
- var sink = new RollingFileSink(pathFormat, formatter, fileSizeLimitBytes, retainedFileCountLimit);
- return sinkConfiguration.Sink(sink, restrictedToMinimumLevel);
- }
-
- ///
- /// Write log events to the .
- ///
- /// Logger sink configuration.
- /// The minimum level for
- /// events passed through the sink.
- /// A message template describing the format used to write to the sink.
- /// the default is "{Timestamp} [{Level}] {Message}{NewLine}{Exception}".
- /// Supplies culture-specific formatting information, or null.
- /// Configuration object allowing method chaining.
- public static LoggerConfiguration Trace(
- this LoggerSinkConfiguration sinkConfiguration,
- LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
- string outputTemplate = DefaultOutputTemplate,
- IFormatProvider formatProvider = null)
- {
- if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration");
- if (outputTemplate == null) throw new ArgumentNullException("outputTemplate");
- var formatter = new MessageTemplateTextFormatter(outputTemplate, formatProvider);
- return sinkConfiguration.Sink(new DiagnosticTraceSink(formatter), restrictedToMinimumLevel);
- }
-
- ///
- /// Enrich log events with properties from .
- ///
- /// Logger enrichment configuration.
- /// Configuration object allowing method chaining.
- ///
-#if !ASPNETCORE50
- public static LoggerConfiguration FromLogContext(
- this LoggerEnrichmentConfiguration enrichmentConfiguration)
- {
- if (enrichmentConfiguration == null) throw new ArgumentNullException("enrichmentConfiguration");
- return enrichmentConfiguration.With();
- }
-#endif
-
- ///
- /// Enrich log events with a ThreadId property containing the current .
- ///
- /// Logger enrichment configuration.
- /// Configuration object allowing method chaining.
- ///
- public static LoggerConfiguration WithThreadId(
- this LoggerEnrichmentConfiguration enrichmentConfiguration)
- {
- if (enrichmentConfiguration == null) throw new ArgumentNullException("enrichmentConfiguration");
- return enrichmentConfiguration.With();
- }
-
- ///
- /// Enrich log events with a ProcessId property containing the current .
- ///
- /// Logger enrichment configuration.
- /// Configuration object allowing method chaining.
- public static LoggerConfiguration WithProcessId(
- this LoggerEnrichmentConfiguration enrichmentConfiguration)
- {
- if (enrichmentConfiguration == null) throw new ArgumentNullException("enrichmentConfiguration");
- return enrichmentConfiguration.With();
- }
-
- ///
- /// Enrich log events with a MachineName property containing the current .
- ///
- /// Logger enrichment configuration.
- /// Configuration object allowing method chaining.
- public static LoggerConfiguration WithMachineName(
- this LoggerEnrichmentConfiguration enrichmentConfiguration)
- {
- if (enrichmentConfiguration == null) throw new ArgumentNullException("enrichmentConfiguration");
- return enrichmentConfiguration.With();
- }
-
-
- ///
- /// Reads the <appSettings> element of App.config or Web.config, searching for for keys
- /// that look like: serilog:*
, which are used to configure
- /// the logger. To add a sink, use a key like serilog:write-to:File.path
for
- /// each parameter to the sink's configuration method. To add an additional assembly
- /// containing sinks, use serilog:using
. To set the level use
- /// serilog:minimum-level
.
- ///
- /// Logger setting configuration
- /// An object allowing configuration to continue.
- public static LoggerConfiguration AppSettings(
- this LoggerSettingsConfiguration settingConfiguration)
- {
- if (settingConfiguration == null) throw new ArgumentNullException("settingConfiguration");
- return settingConfiguration.Settings(new AppSettingsSettings());
- }
- }
-}
diff --git a/src/Serilog.FullNetFx/Project.json b/src/Serilog.FullNetFx/Project.json
deleted file mode 100644
index 7bcc1afe9..000000000
--- a/src/Serilog.FullNetFx/Project.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "version": "1.0.0-beta-*",
- "dependencies": {
- "Serilog": ""
- },
- "code": "**/*.cs",
- "exclude": "**/*-net40.cs",
-
- "frameworks": {
- "aspnetcore50": {
- "dependencies": {
- "Microsoft.CSharp": "4.0.0-beta-22231",
- "System.Collections": "4.0.10-beta-22231",
- "System.Collections.Concurrent": "4.0.0-beta-22231",
- "System.Collections.NonGeneric": "4.0.0-beta-22231",
- "System.Collections.Specialized": "4.0.0-beta-22231",
- "System.Console": "4.0.0-beta-22231",
- "System.Diagnostics.Debug": "4.0.10-beta-22231",
- "System.Diagnostics.Process": "4.0.0-beta-22231",
- "System.Diagnostics.TraceSource": "4.0.0-beta-22231",
- "System.Diagnostics.Tools": "4.0.0-beta-22231",
- "System.Dynamic.Runtime": "4.0.0-beta-22231",
- "System.Globalization": "4.0.10-beta-22231",
- "System.Globalization.Calendars": "4.0.0-beta-22231",
- "System.IO": "4.0.10-beta-22231",
- "System.IO.FileSystem": "4.0.0-beta-22231",
- "System.IO.FileSystem.Primitives": "4.0.0-beta-22231",
- "System.Linq": "4.0.0-beta-22231",
- "System.Net.Sockets": "4.0.0-beta-22231",
- "System.ObjectModel": "4.0.0-beta-22231",
- "System.Reflection": "4.0.10-beta-22231",
- "System.Runtime": "4.0.20-beta-22231",
- "System.Runtime.Extensions": "4.0.10-beta-22231",
- "System.Runtime.InteropServices": "4.0.20-beta-22231",
- "System.Text.RegularExpressions": "4.0.0-beta-22231",
- "System.Threading.Timer": "4.0.0-beta-22231",
- "System.Threading.Thread": "4.0.0-beta-22231"
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Serilog.FullNetFx/Properties/AssemblyInfo.cs b/src/Serilog.FullNetFx/Properties/AssemblyInfo.cs
deleted file mode 100644
index daca6b6d9..000000000
--- a/src/Serilog.FullNetFx/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-[assembly: AssemblyTitle("Serilog.FullNetFx")]
-[assembly: AssemblyDescription("Serilog Logging Library Full .NET Framework Support")]
-[assembly: AssemblyCopyright("Copyright © Serilog Contributors 2013")]
-
-#if !ASPNETCORE50
-[assembly: InternalsVisibleTo("Serilog.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100fb8d13fd344a1c" +
- "6fe0fe83ef33c1080bf30690765bc6eb0df26ebfdf8f21670c64265b30db09f73a0dea5b3db4c9" +
- "d18dbf6d5a25af5ce9016f281014d79dc3b4201ac646c451830fc7e61a2dfd633d34c39f87b818" +
- "94191652df5ac63cc40c77f3542f702bda692e6e8a9158353df189007a49da0f3cfd55eb250066" +
- "b19485ec")]
-#else
-[assembly: InternalsVisibleTo("Serilog.Tests")]
-#endif
\ No newline at end of file
diff --git a/src/Serilog.FullNetFx/Serilog.FullNetFx-aspnetcore50.kproj b/src/Serilog.FullNetFx/Serilog.FullNetFx-aspnetcore50.kproj
deleted file mode 100644
index cdbf8d9a3..000000000
--- a/src/Serilog.FullNetFx/Serilog.FullNetFx-aspnetcore50.kproj
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
- 14.0
- $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
-
-
-
- 370c3957-e1f5-4818-b391-8dca083d7a9f
- Library
-
-
-
-
-
-
- 2.0
-
-
- True
-
-
-
\ No newline at end of file
diff --git a/src/Serilog.FullNetFx/Serilog.FullNetFx-net40.csproj b/src/Serilog.FullNetFx/Serilog.FullNetFx-net40.csproj
deleted file mode 100644
index f70eb219e..000000000
--- a/src/Serilog.FullNetFx/Serilog.FullNetFx-net40.csproj
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {7A9E1095-167D-402A-B43D-B36B97FF183D}
- Library
- Properties
- Serilog
- Serilog.FullNetFx
- v4.0
- 512
- Client
-
-
- true
- full
- false
- bin40\Debug\
- DEBUG;TRACE
- prompt
- 4
- true
- bin40\Debug\Serilog.FullNetFx.XML
-
-
- pdbonly
- true
- bin40\Release\
- TRACE
- prompt
- 4
- true
- bin40\Release\Serilog.FullNetFx.XML
-
-
- true
-
-
- ..\..\assets\Serilog.snk
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Properties\CommonAssemblyInfo.cs
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Serilog.snk
-
-
-
-
-
-
-
-
-
-
- {0915dbd9-0f7c-4439-8d9e-74c3d579b219}
- Serilog-net40
-
-
-
-
\ No newline at end of file
diff --git a/src/Serilog.FullNetFx/Serilog.FullNetFx.csproj b/src/Serilog.FullNetFx/Serilog.FullNetFx.csproj
deleted file mode 100644
index 36ee2a2d0..000000000
--- a/src/Serilog.FullNetFx/Serilog.FullNetFx.csproj
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {7A9E1095-167D-402A-B43D-B36B97FF183D}
- Library
- Properties
- Serilog
- Serilog.FullNetFx
- v4.5
- 512
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- true
- bin\Debug\Serilog.FullNetFx.XML
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
- true
- bin\Release\Serilog.FullNetFx.XML
-
-
- true
-
-
- ..\..\assets\Serilog.snk
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Properties\CommonAssemblyInfo.cs
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Serilog.snk
-
-
-
-
- {0915dbd9-0f7c-4439-8d9e-74c3d579b219}
- Serilog
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Serilog.FullNetFx/Sinks/PeriodicBatching/PeriodicBatchingSink-net40.cs b/src/Serilog.FullNetFx/Sinks/PeriodicBatching/PeriodicBatchingSink-net40.cs
deleted file mode 100644
index 57f85a4c5..000000000
--- a/src/Serilog.FullNetFx/Sinks/PeriodicBatching/PeriodicBatchingSink-net40.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-// Copyright 2014 Serilog Contributors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using System;
-using System.Collections.Concurrent;
-using System.Collections.Generic;
-using System.Threading;
-using Serilog.Core;
-using Serilog.Debugging;
-using Serilog.Events;
-
-namespace Serilog.Sinks.PeriodicBatching
-{
- ///
- /// Base class for sinks that log events in batches. Batching is
- /// triggered asynchronously on a timer.
- ///
- ///
- /// To avoid unbounded memory growth, events are discarded after attempting
- /// to send a batch, regardless of whether the batch succeeded or not. Implementers
- /// that want to change this behavior need to either implement from scratch, or
- /// embed retry logic in the batch emitting functions.
- ///
- public abstract class PeriodicBatchingSink : ILogEventSink, IDisposable
- {
- readonly int _batchSizeLimit;
- readonly ConcurrentQueue _queue;
- readonly BatchedConnectionStatus _status;
- readonly Queue _waitingBatch = new Queue();
-
- readonly object _stateLock = new object();
- readonly Timer _timer;
- bool _unloading;
- bool _started;
-
- ///
- /// Construct a sink posting to the specified database.
- ///
- /// The maximum number of events to include in a single batch.
- /// The time to wait between checking for event batches.
- protected PeriodicBatchingSink(int batchSizeLimit, TimeSpan period)
- {
- _batchSizeLimit = batchSizeLimit;
- _queue = new ConcurrentQueue();
- _timer = new Timer(s => OnTick());
- _status = new BatchedConnectionStatus(period);
-
- AppDomain.CurrentDomain.DomainUnload += OnAppDomainUnloading;
- AppDomain.CurrentDomain.ProcessExit += OnAppDomainUnloading;
- AppDomain.CurrentDomain.UnhandledException += OnAppDomainUnloading;
- }
-
- void OnAppDomainUnloading(object sender, EventArgs args)
- {
- var eventArgs = args as UnhandledExceptionEventArgs;
- if (eventArgs != null && !eventArgs.IsTerminating)
- return;
-
- CloseAndFlush();
- }
-
- void CloseAndFlush()
- {
- lock (_stateLock)
- {
- if (!_started || _unloading)
- return;
-
- _unloading = true;
- }
-
- AppDomain.CurrentDomain.DomainUnload -= OnAppDomainUnloading;
- AppDomain.CurrentDomain.ProcessExit -= OnAppDomainUnloading;
- AppDomain.CurrentDomain.UnhandledException -= OnAppDomainUnloading;
-
- var wh = new ManualResetEvent(false);
- if (_timer.Dispose(wh))
- wh.WaitOne();
-
- OnTick();
- }
-
- ///
- /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
- ///
- /// 2
- public void Dispose()
- {
- Dispose(true);
- }
-
- ///
- /// Free resources held by the sink.
- ///
- /// If true, called because the object is being disposed; if false,
- /// the object is being disposed from the finalizer.
- protected virtual void Dispose(bool disposing)
- {
- if (!disposing) return;
- CloseAndFlush();
- }
-
- ///
- /// Emit a batch of log events, running to completion synchronously.
- ///
- /// The events to emit.
- protected abstract void EmitBatch(IEnumerable events);
-
- void OnTick()
- {
- try
- {
- do
- {
- LogEvent next;
- while (_waitingBatch.Count < _batchSizeLimit &&
- _queue.TryDequeue(out next))
- {
- if (CanInclude(next))
- _waitingBatch.Enqueue(next);
- }
-
- if (_waitingBatch.Count == 0)
- return;
-
- EmitBatch(_waitingBatch);
- _waitingBatch.Clear();
- _status.MarkSuccess();
- }
- while (true);
- }
- catch (Exception ex)
- {
- SelfLog.WriteLine("Exception while emitting periodic batch from {0}: {1}", this, ex);
- _status.MarkFailure();
- }
- finally
- {
- if (_status.ShouldDropBatch)
- _waitingBatch.Clear();
-
- if (_status.ShouldDropQueue)
- {
- LogEvent evt;
- while (_queue.TryDequeue(out evt)) { }
- }
-
- lock (_stateLock)
- {
- if (!_unloading)
- _timer.Change(_status.NextInterval, TimeSpan.FromMilliseconds(-1));
- }
- }
- }
-
- ///
- /// Emit the provided log event to the sink. If the sink is being disposed or
- /// the app domain unloaded, then the event is ignored.
- ///
- /// Log event to emit.
- /// The event is null.
- ///
- /// The sink implements the contract that any events whose Emit() method has
- /// completed at the time of sink disposal will be flushed (or attempted to,
- /// depending on app domain state).
- ///
- public void Emit(LogEvent logEvent)
- {
- if (logEvent == null) throw new ArgumentNullException("logEvent");
-
- lock (_stateLock)
- {
- if (_unloading) return;
- if (!_started)
- {
- // Special handling to try to get the first event across as quickly
- // as possible to show we're alive!
- _started = true;
- _timer.Change(TimeSpan.Zero, TimeSpan.FromMilliseconds(-1));
- }
- }
-
- _queue.Enqueue(logEvent);
- }
-
- ///
- /// Determine whether a queued log event should be included in the batch. If
- /// an override returns false, the event will be dropped.
- ///
- ///
- ///
- protected virtual bool CanInclude(LogEvent evt)
- {
- return true;
- }
- }
-}
diff --git a/src/Serilog.FullNetFx/Sinks/SystemConsole/ColoredConsoleSink-net40.cs b/src/Serilog.FullNetFx/Sinks/SystemConsole/ColoredConsoleSink-net40.cs
deleted file mode 100644
index 28e679143..000000000
--- a/src/Serilog.FullNetFx/Sinks/SystemConsole/ColoredConsoleSink-net40.cs
+++ /dev/null
@@ -1,170 +0,0 @@
-// Copyright 2013 Serilog Contributors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using System;
-using System.IO;
-using Serilog.Core;
-using Serilog.Events;
-using System.Collections.Generic;
-using Serilog.Formatting.Display;
-using Serilog.Parsing;
-
-namespace Serilog.Sinks.SystemConsole
-{
- class ColoredConsoleSink : ILogEventSink
- {
- readonly IFormatProvider _formatProvider;
-
- class Palette
- {
- public ConsoleColor Base { get; set; }
- public ConsoleColor BaseText { get; set; }
- public ConsoleColor Highlight { get; set; }
- public ConsoleColor HighlightText { get; set; }
- }
-
- static readonly Palette DefaultPalette = new Palette { Base = ConsoleColor.Black, BaseText = ConsoleColor.Gray,
- Highlight = ConsoleColor.DarkGray, HighlightText = ConsoleColor.Gray };
-
- static readonly IDictionary LevelPalettes = new Dictionary
- {
- { LogEventLevel.Verbose, new Palette { Base = ConsoleColor.Black, BaseText = ConsoleColor.DarkGray,
- Highlight = ConsoleColor.Black, HighlightText = ConsoleColor.Gray } },
- { LogEventLevel.Debug, new Palette { Base = ConsoleColor.Black, BaseText = ConsoleColor.Gray,
- Highlight = ConsoleColor.Black, HighlightText = ConsoleColor.White } },
- { LogEventLevel.Information, new Palette { Base = ConsoleColor.Black, BaseText = ConsoleColor.White,
- Highlight = ConsoleColor.DarkBlue, HighlightText = ConsoleColor.White } },
- { LogEventLevel.Warning, new Palette { Base = ConsoleColor.Black, BaseText = ConsoleColor.Yellow,
- Highlight = ConsoleColor.DarkYellow, HighlightText = ConsoleColor.White } },
- { LogEventLevel.Error, new Palette { Base = ConsoleColor.Black, BaseText = ConsoleColor.Red,
- Highlight = ConsoleColor.Red, HighlightText = ConsoleColor.White } },
- { LogEventLevel.Fatal, new Palette { Base = ConsoleColor.DarkRed, BaseText = ConsoleColor.White,
- Highlight = ConsoleColor.Red, HighlightText = ConsoleColor.White } }
- };
-
- readonly object _syncRoot = new object();
- readonly MessageTemplate _outputTemplate;
-
- public ColoredConsoleSink(string outputTemplate, IFormatProvider formatProvider)
- {
- if (outputTemplate == null) throw new ArgumentNullException("outputTemplate");
- _outputTemplate = new MessageTemplateParser().Parse(outputTemplate);
- _formatProvider = formatProvider;
- }
-
- const string StackFrameLinePrefix = " ";
-
- public void Emit(LogEvent logEvent)
- {
- if (logEvent == null) throw new ArgumentNullException("logEvent");
-
- var outputProperties = OutputProperties.GetOutputProperties(logEvent);
- var palette = GetPalette(logEvent.Level);
- var output = Console.Out;
-
- lock (_syncRoot)
- {
- try
- {
- foreach (var outputToken in _outputTemplate.Tokens)
- {
- var propertyToken = outputToken as PropertyToken;
- if (propertyToken == null)
- {
- RenderOutputToken(palette, outputToken, outputProperties, output);
- }
- else switch (propertyToken.PropertyName)
- {
- case OutputProperties.MessagePropertyName:
- RenderMessageToken(logEvent, palette, output);
- break;
- case OutputProperties.ExceptionPropertyName:
- RenderExceptionToken(palette, propertyToken, outputProperties, output);
- break;
- default:
- RenderOutputToken(palette, outputToken, outputProperties, output);
- break;
- }
- }
- }
- finally { Console.ResetColor(); }
- }
- }
-
- void RenderExceptionToken(Palette palette, MessageTemplateToken outputToken, IDictionary outputProperties, TextWriter output)
- {
- var sw = new StringWriter();
- outputToken.Render(outputProperties, sw, _formatProvider);
- var lines = new StringReader(sw.ToString());
- string nextLine;
- while ((nextLine = lines.ReadLine()) != null)
- {
- if (nextLine.StartsWith(StackFrameLinePrefix))
- SetBaseColors(palette);
- else
- SetHighlightColors(palette);
- output.WriteLine(nextLine);
- }
- }
-
- void RenderMessageToken(LogEvent logEvent, Palette palette, TextWriter output)
- {
- foreach (var messageToken in logEvent.MessageTemplate.Tokens)
- {
- var messagePropertyToken = messageToken as PropertyToken;
- if (messagePropertyToken != null)
- {
- SetHighlightColors(palette);
- messageToken.Render(logEvent.Properties, output, _formatProvider);
- }
- else
- {
- SetBaseColors(palette);
- messageToken.Render(logEvent.Properties, output, _formatProvider);
- }
- }
- }
-
- void RenderOutputToken(Palette palette, MessageTemplateToken outputToken, IDictionary outputProperties, TextWriter output)
- {
- SetBaseColors(palette);
- outputToken.Render(outputProperties, output, _formatProvider);
- }
-
- static Palette GetPalette(LogEventLevel level)
- {
- Palette palette;
- if (!LevelPalettes.TryGetValue(level, out palette))
- palette = DefaultPalette;
-
- return palette;
- }
-
- static void SetBaseColors(Palette palette)
- {
- SetColors(palette.Base, palette.BaseText);
- }
-
- static void SetHighlightColors(Palette palette)
- {
- SetColors(palette.Highlight, palette.HighlightText);
- }
-
- static void SetColors(ConsoleColor background, ConsoleColor foreground)
- {
- Console.BackgroundColor = background;
- Console.ForegroundColor = foreground;
- }
- }
-}
diff --git a/src/Serilog/Configuration/LoggerSettingsConfiguration-net40.cs b/src/Serilog/Configuration/LoggerSettingsConfiguration-net40.cs
deleted file mode 100644
index b39ba89ea..000000000
--- a/src/Serilog/Configuration/LoggerSettingsConfiguration-net40.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2015 Serilog Contributors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using System;
-using System.Collections.Generic;
-
-namespace Serilog.Configuration
-{
- ///
- /// Allows additional setting sources to drive the logger configuration.
- ///
- public class LoggerSettingsConfiguration
- {
- readonly LoggerConfiguration _loggerConfiguration;
-
- internal LoggerSettingsConfiguration(LoggerConfiguration loggerConfiguration)
- {
- if (loggerConfiguration == null) throw new ArgumentNullException("loggerConfiguration");
- _loggerConfiguration = loggerConfiguration;
- }
-
- ///
- /// Apply external settings to the logger configuration.
- ///
- /// Configuration object allowing method chaining.
- public LoggerConfiguration Settings(ILoggerSettings settings)
- {
- if (settings == null) throw new ArgumentNullException("settings");
-
- settings.Configure(_loggerConfiguration);
-
- return _loggerConfiguration;
- }
- }
-}
diff --git a/src/Serilog.FullNetFx/Context/ImmutableStack.cs b/src/Serilog/Context/ImmutableStack.cs
similarity index 98%
rename from src/Serilog.FullNetFx/Context/ImmutableStack.cs
rename to src/Serilog/Context/ImmutableStack.cs
index 237cf2ef2..c18064522 100644
--- a/src/Serilog.FullNetFx/Context/ImmutableStack.cs
+++ b/src/Serilog/Context/ImmutableStack.cs
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#if !ASPNETCORE50
+#if !PROFILE259 && !DNXCORE50
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
diff --git a/src/Serilog.FullNetFx/Context/LogContext.cs b/src/Serilog/Context/LogContext.cs
similarity index 99%
rename from src/Serilog.FullNetFx/Context/LogContext.cs
rename to src/Serilog/Context/LogContext.cs
index 21ed80f03..3e2daf464 100644
--- a/src/Serilog.FullNetFx/Context/LogContext.cs
+++ b/src/Serilog/Context/LogContext.cs
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#if !ASPNETCORE50
+#if !PROFILE259 && !DNXCORE50
using System;
using System.Runtime.Remoting.Messaging;
using Serilog.Core;
diff --git a/src/Serilog.FullNetFx/Enrichers/LogContextEnricher.cs b/src/Serilog/Enrichers/LogContextEnricher.cs
similarity index 96%
rename from src/Serilog.FullNetFx/Enrichers/LogContextEnricher.cs
rename to src/Serilog/Enrichers/LogContextEnricher.cs
index f464ace27..a9e89ea1c 100644
--- a/src/Serilog.FullNetFx/Enrichers/LogContextEnricher.cs
+++ b/src/Serilog/Enrichers/LogContextEnricher.cs
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#if !ASPNETCORE50
+#if !PROFILE259 && !DNXCORE50
using Serilog.Context;
using Serilog.Core;
using Serilog.Events;
diff --git a/src/Serilog.FullNetFx/Enrichers/MachineNameEnricher.cs b/src/Serilog/Enrichers/MachineNameEnricher.cs
similarity index 97%
rename from src/Serilog.FullNetFx/Enrichers/MachineNameEnricher.cs
rename to src/Serilog/Enrichers/MachineNameEnricher.cs
index f6be9a7af..044bdb824 100644
--- a/src/Serilog.FullNetFx/Enrichers/MachineNameEnricher.cs
+++ b/src/Serilog/Enrichers/MachineNameEnricher.cs
@@ -16,6 +16,7 @@
using Serilog.Core;
using Serilog.Events;
+#if !PROFILE259
namespace Serilog.Enrichers
{
///
@@ -37,7 +38,7 @@ public class MachineNameEnricher : ILogEventEnricher
/// Factory for creating new properties to add to the event.
public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
{
-#if !ASPNETCORE50
+#if !DNXCORE50
_cachedProperty = _cachedProperty ?? propertyFactory.CreateProperty(MachineNamePropertyName, Environment.MachineName);
#else
_cachedProperty = _cachedProperty ?? propertyFactory.CreateProperty(MachineNamePropertyName, Environment.GetEnvironmentVariable("COMPUTERNAME"));
@@ -46,3 +47,4 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
}
}
}
+#endif
diff --git a/src/Serilog.FullNetFx/Enrichers/ProcessIdEnricher.cs b/src/Serilog/Enrichers/ProcessIdEnricher.cs
similarity index 89%
rename from src/Serilog.FullNetFx/Enrichers/ProcessIdEnricher.cs
rename to src/Serilog/Enrichers/ProcessIdEnricher.cs
index 3a58d7947..9b13a742a 100644
--- a/src/Serilog.FullNetFx/Enrichers/ProcessIdEnricher.cs
+++ b/src/Serilog/Enrichers/ProcessIdEnricher.cs
@@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-using System.Diagnostics;
using Serilog.Core;
using Serilog.Events;
+#if !PROFILE259
namespace Serilog.Enrichers
{
///
- /// Enriches log events with a ProcessId property containing the current .
+ /// Enriches log events with a ProcessId property containing the current .
///
public class ProcessIdEnricher : ILogEventEnricher
{
@@ -37,8 +37,9 @@ public class ProcessIdEnricher : ILogEventEnricher
/// Factory for creating new properties to add to the event.
public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
{
- _cachedProperty = _cachedProperty ?? propertyFactory.CreateProperty(ProcessIdPropertyName, Process.GetCurrentProcess().Id);
+ _cachedProperty = _cachedProperty ?? propertyFactory.CreateProperty(ProcessIdPropertyName, System.Diagnostics.Process.GetCurrentProcess().Id);
logEvent.AddPropertyIfAbsent(_cachedProperty);
}
}
}
+#endif
diff --git a/src/Serilog.FullNetFx/Enrichers/ThreadIdEnricher.cs b/src/Serilog/Enrichers/ThreadIdEnricher.cs
similarity index 98%
rename from src/Serilog.FullNetFx/Enrichers/ThreadIdEnricher.cs
rename to src/Serilog/Enrichers/ThreadIdEnricher.cs
index f2cb9cf3f..99699d60d 100644
--- a/src/Serilog.FullNetFx/Enrichers/ThreadIdEnricher.cs
+++ b/src/Serilog/Enrichers/ThreadIdEnricher.cs
@@ -16,6 +16,7 @@
using Serilog.Core;
using Serilog.Events;
+#if !PROFILE259
namespace Serilog.Enrichers
{
///
@@ -39,3 +40,4 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
}
}
}
+#endif
diff --git a/src/Serilog/Events/DictionaryValue-net40.cs b/src/Serilog/Events/DictionaryValue-net40.cs
deleted file mode 100644
index 39d718a03..000000000
--- a/src/Serilog/Events/DictionaryValue-net40.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright 2013 Serilog Contributors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-
-namespace Serilog.Events
-{
- ///
- /// A value represented as a mapping from keys to values.
- ///
- public class DictionaryValue : LogEventPropertyValue
- {
- readonly IDictionary _elements;
-
- ///
- /// Create a with the provided .
- ///
- /// The key-value mappings represented in the dictionary.
- ///
- public DictionaryValue(IEnumerable> elements)
- {
- if (elements == null) throw new ArgumentNullException("elements");
- _elements = elements.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
- }
-
- ///
- /// The dictionary mapping.
- ///
- public IDictionary Elements { get { return _elements; } }
-
- ///
- /// Render the value to the output.
- ///
- /// The output.
- /// A format string applied to the value, or null.
- /// A format provider to apply to the value, or null to use the default.
- /// .
- public override void Render(TextWriter output, string format = null, IFormatProvider formatProvider = null)
- {
- if (output == null) throw new ArgumentNullException("output");
-
- output.Write('[');
- var delim = "(";
- foreach (var kvp in _elements)
- {
- output.Write(delim);
- delim = ", (";
- kvp.Key.Render(output, null, formatProvider);
- output.Write(": ");
- kvp.Value.Render(output, null, formatProvider);
- output.Write(")");
- }
-
- output.Write(']');
- }
- }
-}
diff --git a/src/Serilog/Events/DictionaryValue.cs b/src/Serilog/Events/DictionaryValue.cs
index e1403bef0..b12da0b0c 100644
--- a/src/Serilog/Events/DictionaryValue.cs
+++ b/src/Serilog/Events/DictionaryValue.cs
@@ -17,6 +17,12 @@
using System.IO;
using System.Linq;
+#if NET40
+using IScalarDictionary = System.Collections.Generic.IDictionary;
+#else
+using IScalarDictionary = System.Collections.Generic.IReadOnlyDictionary;
+#endif
+
namespace Serilog.Events
{
///
@@ -24,7 +30,7 @@ namespace Serilog.Events
///
public class DictionaryValue : LogEventPropertyValue
{
- readonly IReadOnlyDictionary _elements;
+ readonly IScalarDictionary _elements;
///
/// Create a with the provided .
@@ -40,7 +46,7 @@ public DictionaryValue(IEnumerable
/// The dictionary mapping.
///
- public IReadOnlyDictionary Elements { get { return _elements; } }
+ public IScalarDictionary Elements { get { return _elements; } }
///
/// Render the value to the output.
diff --git a/src/Serilog/Events/LogEvent-net40.cs b/src/Serilog/Events/LogEvent-net40.cs
deleted file mode 100644
index 4bb155ba1..000000000
--- a/src/Serilog/Events/LogEvent-net40.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-// Copyright 2013 Serilog Contributors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-
-namespace Serilog.Events
-{
- ///
- /// A log event.
- ///
- public class LogEvent
- {
- readonly DateTimeOffset _timestamp;
- readonly LogEventLevel _level;
- readonly Exception _exception;
- readonly MessageTemplate _messageTemplate;
- readonly Dictionary _properties;
-
- ///
- /// Construct a new .
- ///
- /// The time at which the event occurred.
- /// The level of the event.
- /// An exception associated with the event, or null.
- /// The message template describing the event.
- /// Properties associated with the event, including those presented in .
- public LogEvent(DateTimeOffset timestamp, LogEventLevel level, Exception exception, MessageTemplate messageTemplate, IEnumerable properties)
- {
- if (messageTemplate == null) throw new ArgumentNullException("messageTemplate");
- if (properties == null) throw new ArgumentNullException("properties");
- _timestamp = timestamp;
- _level = level;
- _exception = exception;
- _messageTemplate = messageTemplate;
- _properties = new Dictionary();
- foreach (var p in properties)
- AddOrUpdateProperty(p);
- }
-
- ///
- /// The time at which the event occurred.
- ///
- public DateTimeOffset Timestamp
- {
- get { return _timestamp; }
- }
-
- ///
- /// The level of the event.
- ///
- public LogEventLevel Level
- {
- get { return _level; }
- }
-
- ///
- /// The message template describing the event.
- ///
- public MessageTemplate MessageTemplate
- {
- get { return _messageTemplate; }
- }
-
- ///
- /// Render the message template to the specified output, given the properties associated
- /// with the event.
- ///
- /// The output.
- /// Supplies culture-specific formatting information, or null.
- public void RenderMessage(TextWriter output, IFormatProvider formatProvider = null)
- {
- MessageTemplate.Render(Properties, output, formatProvider);
- }
-
- ///
- /// Render the message template given the properties associated
- /// with the event, and return the result.
- ///
- /// Supplies culture-specific formatting information, or null.
- public string RenderMessage(IFormatProvider formatProvider = null)
- {
- return MessageTemplate.Render(Properties, formatProvider);
- }
-
- ///
- /// Properties associated with the event, including those presented in .
- ///
- public IDictionary Properties
- {
- get { return _properties; }
- }
-
- ///
- /// An exception associated with the event, or null.
- ///
- public Exception Exception
- {
- get { return _exception; }
- }
-
- ///
- /// Add a property to the event if not already present, otherwise, update its value.
- ///
- /// The property to add or update.
- ///
- public void AddOrUpdateProperty(LogEventProperty property)
- {
- if (property == null) throw new ArgumentNullException("property");
- _properties[property.Name] = property.Value;
- }
-
- ///
- /// Add a property to the event if not already present.
- ///
- /// The property to add.
- ///
- public void AddPropertyIfAbsent(LogEventProperty property)
- {
- if (property == null) throw new ArgumentNullException("property");
- if (!_properties.ContainsKey(property.Name))
- _properties.Add(property.Name, property.Value);
- }
-
- ///
- /// Remove a property from the event, if present. Otherwise no action
- /// is performed.
- ///
- /// The name of the property to remove.
- public void RemovePropertyIfPresent(string propertyName)
- {
- _properties.Remove(propertyName);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Serilog/Events/LogEvent.cs b/src/Serilog/Events/LogEvent.cs
index d2e87d21e..bd117f0cb 100644
--- a/src/Serilog/Events/LogEvent.cs
+++ b/src/Serilog/Events/LogEvent.cs
@@ -16,6 +16,12 @@
using System.Collections.Generic;
using System.IO;
+#if NET40
+using IPropertyDictionary = System.Collections.Generic.IDictionary;
+#else
+using IPropertyDictionary = System.Collections.Generic.IReadOnlyDictionary;
+#endif
+
namespace Serilog.Events
{
///
@@ -98,7 +104,7 @@ public string RenderMessage(IFormatProvider formatProvider = null)
///
/// Properties associated with the event, including those presented in .
///
- public IReadOnlyDictionary Properties
+ public IPropertyDictionary Properties
{
get { return _properties; }
}
diff --git a/src/Serilog/Events/MessageTemplate-net40.cs b/src/Serilog/Events/MessageTemplate-net40.cs
deleted file mode 100644
index bd44f190b..000000000
--- a/src/Serilog/Events/MessageTemplate-net40.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright 2013 Serilog Contributors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using Serilog.Debugging;
-using Serilog.Parsing;
-
-namespace Serilog.Events
-{
- ///
- /// Represents a message template passed to a log method. The template
- /// can subsequently render the template in textual form given the list
- /// of properties.
- ///
- public class MessageTemplate
- {
- readonly string _text;
- readonly MessageTemplateToken[] _tokens;
-
- // Optimisation for when the template is bound to
- // property values.
- readonly PropertyToken[] _positionalProperties;
- readonly PropertyToken[] _namedProperties;
-
- ///
- /// Construct a message template using manually-defined text and property tokens.
- ///
- /// The text and property tokens defining the template.
- public MessageTemplate(IEnumerable tokens)
- : this(string.Join("", tokens), tokens)
- {
- }
-
- ///
- /// Construct a message template using manually-defined text and property tokens.
- ///
- /// The full text of the template; used by Serilog internally to avoid unneeded
- /// string concatenation.
- /// The text and property tokens defining the template.
- public MessageTemplate(string text, IEnumerable tokens)
- {
- if (text == null) throw new ArgumentNullException("text");
- if (tokens == null) throw new ArgumentNullException("tokens");
-
- _text = text;
- _tokens = tokens.ToArray();
-
- var propertyTokens = _tokens.OfType().ToArray();
- if (propertyTokens.Length != 0)
- {
- var allPositional = true;
- var anyPositional = false;
- foreach (var propertyToken in propertyTokens)
- {
- if (propertyToken.IsPositional)
- anyPositional = true;
- else
- allPositional = false;
- }
-
- if (allPositional)
- {
- _positionalProperties = propertyTokens;
- }
- else
- {
- if (anyPositional)
- SelfLog.WriteLine("Message template is malformed: {0}", text);
-
- _namedProperties = propertyTokens;
- }
- }
- }
-
- ///
- /// The raw text describing the template.
- ///
- public string Text
- {
- get { return _text; }
- }
-
- ///
- /// Render the template as a string.
- ///
- /// The string representation of the template.
- public override string ToString()
- {
- return Text;
- }
-
- ///
- /// The tokens parsed from the template.
- ///
- public IEnumerable Tokens
- {
- get { return _tokens; }
- }
-
- internal PropertyToken[] NamedProperties
- {
- get { return _namedProperties; }
- }
-
- internal PropertyToken[] PositionalProperties
- {
- get { return _positionalProperties; }
- }
-
- ///
- /// Convert the message template into a textual message, given the
- /// properties matching the tokens in the message template.
- ///
- /// Properties matching template tokens.
- /// Supplies culture-specific formatting information, or null.
- /// The message created from the template and properties. If the
- /// properties are mismatched with the template, the template will be
- /// returned with incomplete substitution.
- public string Render(IDictionary properties, IFormatProvider formatProvider = null)
- {
- var writer = new StringWriter(formatProvider);
- Render(properties, writer, formatProvider);
- return writer.ToString();
- }
-
- ///
- /// Convert the message template into a textual message, given the
- /// properties matching the tokens in the message template.
- ///
- /// Properties matching template tokens.
- /// The message created from the template and properties. If the
- /// properties are mismatched with the template, the template will be
- /// returned with incomplete substitution.
- /// Supplies culture-specific formatting information, or null.
- public void Render(IDictionary properties, TextWriter output, IFormatProvider formatProvider = null)
- {
- foreach (var token in _tokens)
- {
- token.Render(properties, output, formatProvider);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Serilog/Events/MessageTemplate.cs b/src/Serilog/Events/MessageTemplate.cs
index f09f3aa23..31c9f93bf 100644
--- a/src/Serilog/Events/MessageTemplate.cs
+++ b/src/Serilog/Events/MessageTemplate.cs
@@ -19,6 +19,12 @@
using Serilog.Debugging;
using Serilog.Parsing;
+#if NET40
+using IPropertyDictionary = System.Collections.Generic.IDictionary;
+#else
+using IPropertyDictionary = System.Collections.Generic.IReadOnlyDictionary;
+#endif
+
namespace Serilog.Events
{
///
@@ -130,7 +136,7 @@ internal PropertyToken[] PositionalProperties
/// The message created from the template and properties. If the
/// properties are mismatched with the template, the template will be
/// returned with incomplete substitution.
- public string Render(IReadOnlyDictionary properties, IFormatProvider formatProvider = null)
+ public string Render(IPropertyDictionary properties, IFormatProvider formatProvider = null)
{
var writer = new StringWriter(formatProvider);
Render(properties, writer, formatProvider);
@@ -146,7 +152,7 @@ public string Render(IReadOnlyDictionary properti
/// properties are mismatched with the template, the template will be
/// returned with incomplete substitution.
/// Supplies culture-specific formatting information, or null.
- public void Render(IReadOnlyDictionary properties, TextWriter output, IFormatProvider formatProvider = null)
+ public void Render(IPropertyDictionary properties, TextWriter output, IFormatProvider formatProvider = null)
{
foreach (var token in _tokens)
{
diff --git a/src/Serilog/Events/SequenceValue-net40.cs b/src/Serilog/Events/SequenceValue-net40.cs
deleted file mode 100644
index 5d509f18b..000000000
--- a/src/Serilog/Events/SequenceValue-net40.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2013 Serilog Contributors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-
-namespace Serilog.Events
-{
- ///
- /// A value represented as an ordered sequence of values.
- ///
- public class SequenceValue : LogEventPropertyValue
- {
- readonly LogEventPropertyValue[] _elements;
-
- ///
- /// Create a with the provided .
- ///
- /// The elements of the sequence.
- ///
- public SequenceValue(IEnumerable elements)
- {
- if (elements == null) throw new ArgumentNullException("elements");
- _elements = elements.ToArray();
- }
-
- ///
- /// The elements of the sequence.
- ///
- public IList Elements { get { return _elements; } }
-
- ///
- /// Render the value to the output.
- ///
- /// The output.
- /// A format string applied to the value, or null.
- /// A format provider to apply to the value, or null to use the default.
- /// .
- public override void Render(TextWriter output, string format = null, IFormatProvider formatProvider = null)
- {
- if (output == null) throw new ArgumentNullException("output");
-
- output.Write('[');
- var allButLast = _elements.Length - 1;
- for (var i = 0; i < allButLast; ++i )
- {
- _elements[i].Render(output, format, formatProvider);
- output.Write(", ");
- }
-
- if (_elements.Length > 0)
- _elements[_elements.Length - 1].Render(output, format, formatProvider);
-
- output.Write(']');
- }
- }
-}
\ No newline at end of file
diff --git a/src/Serilog/Events/SequenceValue.cs b/src/Serilog/Events/SequenceValue.cs
index bdc540df8..e2e6c94bb 100644
--- a/src/Serilog/Events/SequenceValue.cs
+++ b/src/Serilog/Events/SequenceValue.cs
@@ -17,6 +17,12 @@
using System.IO;
using System.Linq;
+#if NET40
+using IPropertyValueList = System.Collections.Generic.IList;
+#else
+using IPropertyValueList = System.Collections.Generic.IReadOnlyList;
+#endif
+
namespace Serilog.Events
{
///
@@ -40,7 +46,7 @@ public SequenceValue(IEnumerable elements)
///
/// The elements of the sequence.
///
- public IReadOnlyList Elements { get { return _elements; } }
+ public IPropertyValueList Elements { get { return _elements; } }
///
/// Render the value to the output.
diff --git a/src/Serilog/Events/StructureValue-net40.cs b/src/Serilog/Events/StructureValue-net40.cs
deleted file mode 100644
index 33530becc..000000000
--- a/src/Serilog/Events/StructureValue-net40.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-using System;
-using System.Collections.Generic;
-// Copyright 2013 Serilog Contributors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using System.IO;
-using System.Linq;
-
-namespace Serilog.Events
-{
- ///
- /// A value represented as a collection of name-value properties.
- ///
- public class StructureValue : LogEventPropertyValue
- {
- readonly string _typeTag;
- readonly LogEventProperty[] _properties;
-
- ///
- /// Construct a with the provided properties.
- ///
- /// Optionally, a piece of metadata describing the "type" of the
- /// structure.
- /// The properties of the structure.
- ///
- public StructureValue(IEnumerable properties, string typeTag = null)
- {
- if (properties == null) throw new ArgumentNullException("properties");
- _typeTag = typeTag;
- _properties = properties.ToArray();
- }
-
- ///
- /// A piece of metadata describing the "type" of the
- /// structure, or null.
- ///
- public string TypeTag { get { return _typeTag; } }
-
- ///
- /// The properties of the structure.
- ///
- /// Not presented as a dictionary because dictionary construction is
- /// relatively expensive; it is cheaper to build a dictionary over properties only
- /// when the structure is of interest.
- public IList Properties { get { return _properties; } }
-
- ///
- /// Render the value to the output.
- ///
- /// The output.
- /// A format string applied to the value, or null.
- /// A format provider to apply to the value, or null to use the default.
- /// .
- public override void Render(TextWriter output, string format = null, IFormatProvider formatProvider = null)
- {
- if (output == null) throw new ArgumentNullException("output");
-
- if (_typeTag != null)
- {
- output.Write(_typeTag);
- output.Write(' ');
- }
- output.Write("{ ");
- var allButLast = _properties.Length - 1;
- for (var i = 0; i < allButLast; i++)
- {
- var property = _properties[i];
- Render(output, property, formatProvider);
- output.Write(", ");
- }
-
- if (_properties.Length > 0)
- {
- var last = _properties[_properties.Length - 1];
- Render(output, last, formatProvider);
- }
-
- output.Write(" }");
- }
-
- static void Render(TextWriter output, LogEventProperty property, IFormatProvider formatProvider = null)
- {
- output.Write(property.Name);
- output.Write(": ");
- property.Value.Render(output, null, formatProvider);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Serilog/Events/StructureValue.cs b/src/Serilog/Events/StructureValue.cs
index 3af1b5119..ff14305df 100644
--- a/src/Serilog/Events/StructureValue.cs
+++ b/src/Serilog/Events/StructureValue.cs
@@ -17,6 +17,12 @@
using System.IO;
using System.Linq;
+#if NET40
+using IPropertyList = System.Collections.Generic.IList;
+#else
+using IPropertyList = System.Collections.Generic.IReadOnlyList;
+#endif
+
namespace Serilog.Events
{
///
@@ -53,7 +59,7 @@ public StructureValue(IEnumerable properties, string typeTag =
/// Not presented as a dictionary because dictionary construction is
/// relatively expensive; it is cheaper to build a dictionary over properties only
/// when the structure is of interest.
- public IReadOnlyList Properties { get { return _properties; } }
+ public IPropertyList Properties { get { return _properties; } }
///
/// Render the value to the output.
diff --git a/src/Serilog/Formatting/Display/LogEventPropertyMessageValue-net40.cs b/src/Serilog/Formatting/Display/LogEventPropertyMessageValue-net40.cs
deleted file mode 100644
index 4498b94bf..000000000
--- a/src/Serilog/Formatting/Display/LogEventPropertyMessageValue-net40.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2013 Serilog Contributors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using Serilog.Events;
-
-namespace Serilog.Formatting.Display
-{
- class LogEventPropertyMessageValue : LogEventPropertyValue
- {
- readonly MessageTemplate _template;
- readonly IDictionary _properties;
-
- public LogEventPropertyMessageValue(MessageTemplate template, IDictionary properties)
- {
- _template = template;
- _properties = properties;
- }
-
- public override void Render(TextWriter output, string format = null, IFormatProvider formatProvider = null)
- {
- _template.Render(_properties, output, formatProvider);
- }
- }
-}
diff --git a/src/Serilog/Formatting/Display/LogEventPropertyMessageValue.cs b/src/Serilog/Formatting/Display/LogEventPropertyMessageValue.cs
index 791561c63..7b5c78a2b 100644
--- a/src/Serilog/Formatting/Display/LogEventPropertyMessageValue.cs
+++ b/src/Serilog/Formatting/Display/LogEventPropertyMessageValue.cs
@@ -13,18 +13,23 @@
// limitations under the License.
using System;
-using System.Collections.Generic;
using System.IO;
using Serilog.Events;
+#if NET40
+using IPropertyDictionary = System.Collections.Generic.IDictionary;
+#else
+using IPropertyDictionary = System.Collections.Generic.IReadOnlyDictionary;
+#endif
+
namespace Serilog.Formatting.Display
{
class LogEventPropertyMessageValue : LogEventPropertyValue
{
readonly MessageTemplate _template;
- readonly IReadOnlyDictionary _properties;
+ readonly IPropertyDictionary _properties;
- public LogEventPropertyMessageValue(MessageTemplate template, IReadOnlyDictionary properties)
+ public LogEventPropertyMessageValue(MessageTemplate template, IPropertyDictionary properties)
{
_template = template;
_properties = properties;
diff --git a/src/Serilog/Formatting/Display/OutputProperties-net40.cs b/src/Serilog/Formatting/Display/OutputProperties-net40.cs
deleted file mode 100644
index 36e7a5588..000000000
--- a/src/Serilog/Formatting/Display/OutputProperties-net40.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2013 Serilog Contributors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Serilog.Events;
-
-namespace Serilog.Formatting.Display
-{
- ///
- /// Describes the properties available in standard message template-based
- /// output format strings.
- ///
- public static class OutputProperties
- {
- ///
- /// The message rendered from the log event.
- ///
- public const string MessagePropertyName = "Message";
-
- ///
- /// The timestamp of the log event.
- ///
- public const string TimestampPropertyName = "Timestamp";
-
- ///
- /// The level of the log event.
- ///
- public const string LevelPropertyName = "Level";
-
- ///
- /// A new line.
- ///
- public const string NewLinePropertyName = "NewLine";
-
- ///
- /// The exception associated with the log event.
- ///
- public const string ExceptionPropertyName = "Exception";
-
- ///
- /// Create properties from the provided log event.
- ///
- /// The log event.
- /// A dictionary with properties representing the log event.
- public static IDictionary GetOutputProperties(LogEvent logEvent)
- {
- var result = logEvent.Properties.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
-
- // "Special" output properties like Message will override any properties with the same name
- // when used in format strings; this doesn't affect the rendering of the message template,
- // which uses only the log event properties.
-
- result[MessagePropertyName] = new LogEventPropertyMessageValue(logEvent.MessageTemplate, logEvent.Properties);
- result[TimestampPropertyName] = new ScalarValue(logEvent.Timestamp);
- result[LevelPropertyName] = new ScalarValue(logEvent.Level);
- result[NewLinePropertyName] = new LiteralStringValue(Environment.NewLine);
-
- var exception = logEvent.Exception == null ? "" : (logEvent.Exception + Environment.NewLine);
- result[ExceptionPropertyName] = new LiteralStringValue(exception);
-
- return result;
- }
- }
-}
diff --git a/src/Serilog/Formatting/Display/OutputProperties.cs b/src/Serilog/Formatting/Display/OutputProperties.cs
index 62ad6f987..4ab6859c2 100644
--- a/src/Serilog/Formatting/Display/OutputProperties.cs
+++ b/src/Serilog/Formatting/Display/OutputProperties.cs
@@ -17,6 +17,12 @@
using System.Linq;
using Serilog.Events;
+#if NET40
+using IPropertyDictionary = System.Collections.Generic.IDictionary;
+#else
+using IPropertyDictionary = System.Collections.Generic.IReadOnlyDictionary;
+#endif
+
namespace Serilog.Formatting.Display
{
///
@@ -55,7 +61,7 @@ public static class OutputProperties
///
/// The log event.
/// A dictionary with properties representing the log event.
- public static IReadOnlyDictionary GetOutputProperties(LogEvent logEvent)
+ public static IPropertyDictionary GetOutputProperties(LogEvent logEvent)
{
var result = logEvent.Properties.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
diff --git a/src/Serilog/Formatting/Json/JsonFormatter-net40.cs b/src/Serilog/Formatting/Json/JsonFormatter-net40.cs
deleted file mode 100644
index 2671d622f..000000000
--- a/src/Serilog/Formatting/Json/JsonFormatter-net40.cs
+++ /dev/null
@@ -1,463 +0,0 @@
-// Copyright 2014 Serilog Contributors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Text;
-using Serilog.Events;
-using Serilog.Parsing;
-
-namespace Serilog.Formatting.Json
-{
- ///
- /// Formats log events in a simple JSON structure. Instances of this class
- /// are safe for concurrent access by multiple threads.
- ///
- public class JsonFormatter : ITextFormatter
- {
- readonly bool _omitEnclosingObject;
- readonly string _closingDelimiter;
- readonly bool _renderMessage;
- readonly IFormatProvider _formatProvider;
- readonly IDictionary> _literalWriters;
-
- ///
- /// Construct a . Obsolete, please use named arguments
- /// when calling this constructor.
- ///
- [Obsolete("Use named arguments with this method to guarantee forwards-compatibility."), EditorBrowsable(EditorBrowsableState.Never)]
- public JsonFormatter(bool omitEnclosingObjectObsolete)
- : this(omitEnclosingObject: omitEnclosingObjectObsolete)
- {
- }
-
- ///
- /// Construct a .
- ///
- /// If true, the properties of the event will be written to
- /// the output without enclosing braces. Otherwise, if false, each event will be written as a well-formed
- /// JSON object.
- /// A string that will be written after each log event is formatted.
- /// If null, will be used. Ignored if
- /// is true.
- /// If true, the message will be rendered and written to the output as a
- /// property named RenderedMessage.
- /// Supplies culture-specific formatting information, or null.
- public JsonFormatter(
- bool omitEnclosingObject = false,
- string closingDelimiter = null,
- bool renderMessage = false,
- IFormatProvider formatProvider = null)
- {
- _omitEnclosingObject = omitEnclosingObject;
- _closingDelimiter = closingDelimiter ?? Environment.NewLine;
- _renderMessage = renderMessage;
- _formatProvider = formatProvider;
-
- _literalWriters = new Dictionary>
- {
- { typeof(bool), (v, q, w) => WriteBoolean((bool)v, w) },
- { typeof(char), (v, q, w) => WriteString(((char)v).ToString(), w) },
- { typeof(byte), WriteToString },
- { typeof(sbyte), WriteToString },
- { typeof(short), WriteToString },
- { typeof(ushort), WriteToString },
- { typeof(int), WriteToString },
- { typeof(uint), WriteToString },
- { typeof(long), WriteToString },
- { typeof(ulong), WriteToString },
- { typeof(float), WriteToString },
- { typeof(double), WriteToString },
- { typeof(decimal), WriteToString },
- { typeof(string), (v, q, w) => WriteString((string)v, w) },
- { typeof(DateTime), (v, q, w) => WriteDateTime((DateTime)v, w) },
- { typeof(DateTimeOffset), (v, q, w) => WriteOffset((DateTimeOffset)v, w) },
- { typeof(ScalarValue), (v, q, w) => WriteLiteral(((ScalarValue)v).Value, w, q) },
- { typeof(SequenceValue), (v, q, w) => WriteSequence(((SequenceValue)v).Elements, w) },
- { typeof(DictionaryValue), (v, q, w) => WriteDictionary(((DictionaryValue)v).Elements, w) },
- { typeof(StructureValue), (v, q, w) => WriteStructure(((StructureValue)v).TypeTag, ((StructureValue)v).Properties, w) },
- };
- }
-
- ///
- /// Format the log event into the output.
- ///
- /// The event to format.
- /// The output.
- public void Format(LogEvent logEvent, TextWriter output)
- {
- if (logEvent == null) throw new ArgumentNullException("logEvent");
- if (output == null) throw new ArgumentNullException("output");
-
- if (!_omitEnclosingObject)
- output.Write("{");
-
- var delim = "";
- WriteTimestamp(logEvent.Timestamp, ref delim, output);
- WriteLevel(logEvent.Level, ref delim, output);
- WriteMessageTemplate(logEvent.MessageTemplate.Text, ref delim, output);
- if (_renderMessage)
- {
- var message = logEvent.RenderMessage(_formatProvider);
- WriteRenderedMessage(message, ref delim, output);
- }
-
- if (logEvent.Exception != null)
- WriteException(logEvent.Exception, ref delim, output);
-
- if (logEvent.Properties.Count != 0)
- WriteProperties(logEvent.Properties, output);
-
- var tokensWithFormat = logEvent.MessageTemplate.Tokens
- .OfType()
- .Where(pt => pt.Format != null)
- .GroupBy(pt => pt.PropertyName)
- .ToArray();
-
- if (tokensWithFormat.Length != 0)
- {
- WriteRenderings(tokensWithFormat, logEvent.Properties, output);
-
-
- }
-
- if (!_omitEnclosingObject)
- {
- output.Write("}");
- output.Write(_closingDelimiter);
- }
- }
-
- ///
- /// Writes out individual renderings of attached properties
- ///
- protected virtual void WriteRenderings(IGrouping[] tokensWithFormat, IDictionary properties, TextWriter output)
- {
- output.Write(",\"{0}\":{{", "Renderings");
- WriteRenderingsValues(tokensWithFormat, properties, output);
- output.Write("}");
- }
-
- ///
- /// Writes out the values of individual renderings of attached properties
- ///
- protected virtual void WriteRenderingsValues(IGrouping[] tokensWithFormat, IDictionary properties, TextWriter output)
- {
- var rdelim = "";
- foreach (var ptoken in tokensWithFormat)
- {
- output.Write(rdelim);
- rdelim = ",";
- output.Write("\"");
- output.Write(ptoken.Key);
- output.Write("\":[");
-
- var fdelim = "";
- foreach (var format in ptoken)
- {
- output.Write(fdelim);
- fdelim = ",";
-
- output.Write("{");
- var eldelim = "";
-
- WriteJsonProperty("Format", format.Format, ref eldelim, output);
-
- var sw = new StringWriter();
- format.Render(properties, sw);
- WriteJsonProperty("Rendering", sw.ToString(), ref eldelim, output);
-
- output.Write("}");
- }
-
- output.Write("]");
- }
- }
-
- ///
- /// Writes out the attached properties
- ///
- protected virtual void WriteProperties(IDictionary properties, TextWriter output)
- {
- output.Write(",\"{0}\":{{", "Properties");
- WritePropertiesValues(properties, output);
- output.Write("}");
- }
-
- ///
- /// Writes out the attached properties values
- ///
- protected virtual void WritePropertiesValues(IDictionary properties, TextWriter output)
- {
- var precedingDelimiter = "";
- foreach (var property in properties)
- {
- WriteJsonProperty(property.Key, property.Value, ref precedingDelimiter, output);
- }
- }
-
- ///
- /// Writes out the attached exception
- ///
- protected virtual void WriteException(Exception exception, ref string delim, TextWriter output)
- {
- WriteJsonProperty("Exception", exception, ref delim, output);
- }
-
- ///
- /// (Optionally) writes out the rendered message
- ///
- protected virtual void WriteRenderedMessage(string message, ref string delim, TextWriter output)
- {
- WriteJsonProperty("RenderedMessage", message, ref delim, output);
- }
-
- ///
- /// Writes out the message template for the logevent.
- ///
- protected virtual void WriteMessageTemplate(string template, ref string delim, TextWriter output)
- {
- WriteJsonProperty("MessageTemplate", template, ref delim, output);
- }
-
- ///
- /// Writes out the log level
- ///
- protected virtual void WriteLevel(LogEventLevel level, ref string delim, TextWriter output)
- {
- WriteJsonProperty("Level", level, ref delim, output);
- }
-
- ///
- /// Writes out the log timestamp
- ///
- protected virtual void WriteTimestamp(DateTimeOffset timestamp, ref string delim, TextWriter output)
- {
- WriteJsonProperty("Timestamp", timestamp, ref delim, output);
- }
-
- ///
- /// Writes out a structure property
- ///
- protected virtual void WriteStructure(string typeTag, IEnumerable properties, TextWriter output)
- {
- output.Write("{");
-
- var delim = "";
- if (typeTag != null)
- WriteJsonProperty("_typeTag", typeTag, ref delim, output);
-
- foreach (var property in properties)
- WriteJsonProperty(property.Name, property.Value, ref delim, output);
-
- output.Write("}");
- }
-
- ///
- /// Writes out a sequence property
- ///
- protected virtual void WriteSequence(IEnumerable elements, TextWriter output)
- {
- output.Write("[");
- var delim = "";
- foreach (var value in elements)
- {
- output.Write(delim);
- delim = ",";
- WriteLiteral(value, output);
- }
- output.Write("]");
- }
-
- ///
- /// Writes out a dictionary
- ///
- protected virtual void WriteDictionary(IDictionary elements, TextWriter output)
- {
- output.Write("{");
- var delim = "";
- foreach (var e in elements)
- {
- output.Write(delim);
- delim = ",";
- WriteLiteral(e.Key, output, true);
- output.Write(":");
- WriteLiteral(e.Value, output);
- }
- output.Write("}");
- }
-
- ///
- /// Writes out a json property with the specified value on output writer
- ///
- protected virtual void WriteJsonProperty(string name, object value, ref string precedingDelimiter, TextWriter output)
- {
- output.Write(precedingDelimiter);
- output.Write("\"");
- output.Write(name);
- output.Write("\":");
- WriteLiteral(value, output);
- precedingDelimiter = ",";
- }
-
- ///
- /// Allows a subclass to write out objects that have no configured literal writer.
- ///
- /// The value to be written as a json construct
- /// The writer to write on
- protected virtual void WriteLiteralValue(object value, TextWriter output)
- {
- WriteString(value.ToString(), output);
- }
-
- void WriteLiteral(object value, TextWriter output, bool forceQuotation = false)
- {
- if (value == null)
- {
- output.Write("null");
- return;
- }
-
- Action