Skip to content

Commit

Permalink
Merge pull request #13 from serilog/dev
Browse files Browse the repository at this point in the history
1.1.0 Release
  • Loading branch information
nblumhardt authored Jul 6, 2017
2 parents 6539943 + 7b399b8 commit dd80bc6
Show file tree
Hide file tree
Showing 18 changed files with 142 additions and 267 deletions.
19 changes: 6 additions & 13 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,24 @@ if(Test-Path .\artifacts) {
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]
$commitHash = $(git rev-parse --short HEAD)
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]

echo "build: Version suffix is $suffix"
echo "build: Package version suffix is $suffix"
echo "build: Build version suffix is $buildSuffix"

foreach ($src in ls src/*) {
Push-Location $src

echo "build: Packaging project in $src"

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

Pop-Location
}

foreach ($test in ls test/*.PerformanceTests) {
Push-Location $test

echo "build: Building performance test project in $test"

& dotnet build -c Release
if($LASTEXITCODE -ne 0) { exit 2 }

Pop-Location
}

foreach ($test in ls test/*.Tests) {
Push-Location $test

Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ You can get started quickly with this package, and later migrate to the full Ser

### Getting started

**1.** Add [the NuGet package](https://nuget.org/packages/serilog.extensions.logging.file) to the `"dependencies"` section of your `project.json` file:
**1.** Add [the NuGet package](https://nuget.org/packages/serilog.extensions.logging.file) as a dependency of your project either with the package manager or directly to the CSPROJ file:

```json
"dependencies": {
"Serilog.Extensions.Logging.File": "1.0.0"
}
```xml
<PackageReference Include="Serilog.Extensions.Logging.File" Version="1.1.0" />
```

**2.** In your `Startup` class's `Configure()` method, call `AddFile()` on the provided `loggerFactory`.
Expand Down
10 changes: 2 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
version: '{build}'
skip_tags: true
image: Visual Studio 2015
image: Visual Studio 2017
configuration: Release
install:
- ps: mkdir -Force ".\build\" | Out-Null
- ps: Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain/dotnet-install.ps1" -OutFile ".\build\installcli.ps1"
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetcli"
- ps: '& .\build\installcli.ps1 -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath -Version 1.0.0-preview2-003121'
- ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
test: off
build_script:
- ps: ./Build.ps1
test: off
artifacts:
- path: artifacts/Serilog.*.nupkg
deploy:
Expand Down
7 changes: 0 additions & 7 deletions example/WebApplication/Logs/another-20161018.txt

This file was deleted.

6 changes: 6 additions & 0 deletions example/WebApplication/Logs/log-20170630.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
2017-06-30T09:38:55.6849437+10:00 0HL5V900UR4A8 [INF] Request starting HTTP/1.1 DEBUG http://localhost:58951/ 0 (e5be5b71)
2017-06-30T09:38:55.6849437+10:00 0HL5V900UR4A9 [INF] Request starting HTTP/1.1 GET http://localhost:58951/ (e5be5b71)
2017-06-30T09:38:55.8539458+10:00 0HL5V900UR4A8 [INF] Request finished in 184.2573ms 200 (15c52c40)
2017-06-30T09:38:56.3379450+10:00 0HL5V900UR4A9 [INF] Executing action method "WebApplication.Controllers.HomeController.Index (WebApplication)" with arguments (null) - ModelState is Valid (ba7f4ac2)
2017-06-30T09:38:56.3499453+10:00 0HL5V900UR4A9 [INF] Hello, world! (f83bcf75)
2017-06-30T09:38:58.9934553+10:00 0HL5V900UR4A9 [INF] Executing ViewResult, running view at path "/Views/Home/Index.cshtml". (9707eebe)
47 changes: 47 additions & 0 deletions example/WebApplication/WebApplication.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp1.0</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>WebApplication</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>WebApplication</PackageId>
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
</PropertyGroup>

<ItemGroup>
<None Update="wwwroot\**\*;Views\**\*;Areas\**\Views">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Serilog.Extensions.Logging.File\Serilog.Extensions.Logging.File.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.3" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.0.2" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.0.1" />
</ItemGroup>

<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
<Exec Command="bower install" />
<Exec Command="dotnet bundle" />
</Target>

<ItemGroup>
<DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.2.301" />
</ItemGroup>

</Project>
23 changes: 0 additions & 23 deletions example/WebApplication/WebApplication.xproj

This file was deleted.

68 changes: 0 additions & 68 deletions example/WebApplication/project.json

This file was deleted.

6 changes: 0 additions & 6 deletions global.json

This file was deleted.

11 changes: 5 additions & 6 deletions serilog-extensions-logging-file.sln
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.26430.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0069BFD6-B0EE-4204-A85F-F75E31A77B3C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "global", "global", "{B0D573D8-1AE2-4C5C-817A-95815067452E}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
Build.ps1 = Build.ps1
global.json = global.json
LICENSE = LICENSE
README.md = README.md
EndProjectSection
Expand All @@ -18,11 +17,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{D54DE844-A
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "example", "example", "{1C72E771-7C72-4A30-A408-5CE66E792ADF}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApplication", "example\WebApplication\WebApplication.xproj", "{FC44EC1F-AD83-4522-99B4-4B309B8CC78A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplication", "example\WebApplication\WebApplication.csproj", "{FC44EC1F-AD83-4522-99B4-4B309B8CC78A}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Extensions.Logging.File", "src\Serilog.Extensions.Logging.File\Serilog.Extensions.Logging.File.xproj", "{E640A22A-DF3C-40A2-AC72-DEB2F9B16241}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Extensions.Logging.File", "src\Serilog.Extensions.Logging.File\Serilog.Extensions.Logging.File.csproj", "{E640A22A-DF3C-40A2-AC72-DEB2F9B16241}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Extensions.Logging.File.Tests", "test\Serilog.Extensions.Logging.File.Tests\Serilog.Extensions.Logging.File.Tests.xproj", "{64A3F2C5-D71E-44A6-8DC7-99474765B32E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Extensions.Logging.File.Tests", "test\Serilog.Extensions.Logging.File.Tests\Serilog.Extensions.Logging.File.Tests.csproj", "{64A3F2C5-D71E-44A6-8DC7-99474765B32E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,6 @@ public static ILoggerFactory AddFile(
(ITextFormatter)new RenderedCompactJsonFormatter() :
new MessageTemplateTextFormatter("{Timestamp:o} {RequestId,13} [{Level:u3}] {Message} ({EventId:x8}){NewLine}{Exception}", null);

#if SHARING
const bool sharingSupported = true;
#else
const bool sharingSupported = false;
#endif

var configuration = new LoggerConfiguration()
.MinimumLevel.Is(Conversions.MicrosoftToSerilogLevel(minimumLevel))
.Enrich.FromLogContext()
Expand All @@ -131,7 +125,7 @@ public static ILoggerFactory AddFile(
Environment.ExpandEnvironmentVariables(pathFormat),
fileSizeLimitBytes: fileSizeLimitBytes,
retainedFileCountLimit: retainedFileCountLimit,
shared: sharingSupported,
shared: true,
flushToDiskInterval: TimeSpan.FromSeconds(2)));

if (!isJson)
Expand Down
19 changes: 0 additions & 19 deletions src/Serilog.Extensions.Logging.File/Properties/AssemblyInfo.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>Add file logging to ASP.NET Core apps with one line of code.</Description>
<AssemblyVersion>1.0.0</AssemblyVersion>
<VersionPrefix>1.1.0</VersionPrefix>
<Authors>Serilog Contributors</Authors>
<TargetFrameworks>net45;netstandard1.3</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Serilog.Extensions.Logging.File</AssemblyName>
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<PackageId>Serilog.Extensions.Logging.File</PackageId>
<PackageTags>asp.net;core;logging;file</PackageTags>
<PackageIconUrl>http://serilog.net/images/serilog-extension-nuget.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/serilog/serilog-extensions-logging-file</PackageProjectUrl>
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="2.5.0" />
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" />
<PackageReference Include="Serilog.Formatting.Compact" Version="1.0.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="1.4.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="1.0.2" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

</Project>

This file was deleted.

Loading

0 comments on commit dd80bc6

Please sign in to comment.