Skip to content

Commit 63ce390

Browse files
author
Paul M
committed
Merge branch 'master' into develop
2 parents 4b446e8 + 61b79ba commit 63ce390

Some content is hidden

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

53 files changed

+1274
-1094
lines changed

.gitignore

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
1-
################################################################################
2-
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
3-
################################################################################
1+
#Ignore thumbnails created by Windows
2+
Thumbs.db
43

5-
/CoreSrc/StackifyLib/bin/Debug/netcoreapp1.0/StackifyLib.pdb
6-
Src/StackifyLib.log4net/project.lock.json
4+
#Ignore files built by Visual Studio
5+
*.obj
6+
*.exe
7+
*.pdb
8+
*.user
9+
*.aps
10+
*.pch
11+
*.vspscc
12+
*_i.c
13+
*_p.c
14+
*.ncb
15+
*.suo
16+
*.tlb
17+
*.tlh
18+
*.bak
19+
*.cache
20+
*.ilk
21+
*.log
22+
*.dll
23+
*.lib
24+
*.sbr
25+
.idea/
26+
_ReSharper.Caches/
27+
packages/
28+
*.lock.json
29+
30+
**/bin/*
31+
**/obj/*

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Stackify API for .NET
1+
## Stackify API for .NET
22

33
[![Build status](https://ci.appveyor.com/api/projects/status/6suxse470ab4bdxl?svg=true)](https://ci.appveyor.com/project/jaredcnance/stackify-api-dotnet)
44
[![NuGet](https://img.shields.io/nuget/v/StackifyLib.svg)](https://www.nuget.org/packages/StackifyLib/)
@@ -7,7 +7,7 @@ Library for Stackify users to integrate Stackify in to their projects. Provides
77

88
**Important links:**
99
- [Stackify homepage](http://www.stackify.com)
10-
- [Stackify documentation site](http://support.stackify.com/hc/en-us/categories/200398739-Errors-Logs)
10+
- [Stackify documentation site](http://support.stackify.com/)
1111
- [NuGet packages](https://www.nuget.org/packages?q=Stackify)
1212
- [Best practices for logging with C#](https://stackify.com/csharp-logging-best-practices/)
1313
- [Why you should use tags in your logs](https://stackify.com/get-smarter-log-management-with-log-tags/)
@@ -22,7 +22,7 @@ Library for Stackify users to integrate Stackify in to their projects. Provides
2222
- [Direct API](#direct-api)
2323
- [Configuring with Azure service definitions](#configuring-with-azure-service-definitions)
2424

25-
##Basics
25+
## Basics
2626

2727
Several nuget packages are available for Stackify's core API as well as various logging frameworks. Please install the proper packages. All of the available packages for various logging frameworks are wrapper on top of StackifyLib which can also be used directly for logging.
2828

@@ -85,14 +85,13 @@ static void StackifyAPILogger_OnLogMessage(string data)
8585
}
8686
```
8787

88-
Please note that Newtonsoft.Json is used by StackifyLib but is embedded as a resource to avoid version conflicts. Costura.Fody is being used to embed it. If you have any issues with Newtonsoft.Json as a result of using StackifyLib please contact Stackify support.
8988

90-
##Errors and Logs
89+
## Errors and Logs
9190

9291
If you log an object with the message, Stackify's log viewer makes it easy to search by these parameters. You can always search by the text in the log message itself, but searching by the logged properties provides a lot more power. If you always logged a "clientid" for example on every log message, you could search in Stackify for "json.clientid:1" and quickly see all logs and errors affecting that specific client. Another big difference and advantage to logging objects is you can do a range type search "json.clientid:[1 TO 10]" which would not be possible by a straight text search.
9392

9493

95-
###NLog 2.0.1.2 - v3.1+
94+
### NLog 2.0.1.2 - v3.1+
9695

9796
**Install via NuGet package**
9897
```
@@ -131,7 +130,7 @@ Options
131130
- CallContextKeys is an additional feature unrelated to NLog that uses the local thread storage for more advanced tracking of context variables. It is used via CallContext.LogicalSetData(key, value). Research LogicalSetData online to learn more. It is supposed to work better across child Task objects and with async.
132131
- logMethodNames - Method names will show up in the StackifyLog viewer most of the time as the class name that did the logging. For exceptions it will usually show the method name. To enable the exact method name for all logging, set this property to true. Note that it does cause a small performance hit due to walking the StackTrace.
133132

134-
###log4net v2.0+ (v1.2.11+)
133+
### log4net v2.0+ (v1.2.11+)
135134

136135
**Install via NuGet package**
137136
```
@@ -181,7 +180,7 @@ Options
181180
- logMethodNames - Method names will show up in the StackifyLog viewer most of the time as the class name that did the logging. For exceptions it will usually show the method name. To enable the exact method name for all logging, set this property to true. Note that it does cause a small performance hit due to walking the StackTrace.
182181

183182

184-
####log4net Extension Methods
183+
#### log4net Extension Methods
185184

186185
log4net does not internally have methods for logging a log message along with an object. Stackify's appenders work fine if you log an object directly or we have created some friendly extension methods to make it easy to log an object with your message at the same time.
187186

@@ -196,7 +195,7 @@ logger.Debug(dictionary); //This works fine and is indexed and searchable by Sta
196195
logger.Debug("Starting some process for client 1", dictionary); //extension method
197196
```
198197

199-
###log4net v1.2.10
198+
### log4net v1.2.10
200199

201200
**Install via NuGet package**
202201
```
@@ -206,7 +205,7 @@ PM> Install-Package StackifyLib.log4net.v1_2_10
206205
Note: If you use 1.2.10 then you must use our special nuget package for that version. There is no way to use an assembly redirect because the public key of log4net v1 and v2 are different. Everything else is the same about using log4net with Stackify.
207206

208207

209-
###Direct API
208+
### Direct API
210209

211210
**Install via NuGet package**
212211
```
@@ -233,7 +232,7 @@ StackifyLib.Logger.QueueLogObject(msg);
233232

234233
*Make sure you call StackifyLib.Logger.Shutdown() before your app ends to flush the queue*
235234

236-
###Configuring with Azure service definitions
235+
### Configuring with Azure service definitions
237236

238237
StackifyLib reads the license key, app name, and environment settings from normal web.config appSettings. If you would prefer to store the settings in an [azure cloud deployment cscfg](http://msdn.microsoft.com/en-us/library/azure/hh369931.aspx#NameValue), then you can create a little code to read the settings from there and set the StackifyLib settings in code like this in some similar way.
239238

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp1.0</TargetFramework>
4+
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
55
<AssemblyName>CoreConsoleApp</AssemblyName>
66
<OutputType>Exe</OutputType>
77
<PackageId>CoreConsoleApp</PackageId>
88
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
9-
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
10-
<PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
9+
<RuntimeFrameworkVersion>2.0.0</RuntimeFrameworkVersion>
1110
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
1211
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1312
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
1413
</PropertyGroup>
1514

1615
<ItemGroup>
16+
<ProjectReference Include="..\StackifyLib.log4net\StackifyLib.log4net.csproj" />
1717
<ProjectReference Include="..\StackifyLib\StackifyLib.csproj" />
1818
<ProjectReference Include="..\NLog.Targets.Stackify\NLog.Targets.Stackify.csproj" />
19-
<ProjectReference Include="..\StackifyLib.log4net\StackifyLib.log4net.csproj" />
2019
</ItemGroup>
2120

2221
<ItemGroup>
23-
<PackageReference Include="log4net" Version="2.0.7" />
24-
<PackageReference Include="NLog" Version="5.0.0-beta05" />
22+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" />
23+
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.0.0" />
24+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
25+
<PackageReference Include="NLog" Version="4.5.0" />
2526
<PackageReference Include="Serilog" Version="2.4.0" />
26-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="1.2.0-preview1-22736" />
27-
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="1.2.0-preview1-22736" />
28-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.2.0-preview1-22736" />
27+
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
28+
<PackageReference Include="System.Net.Sockets" Version="4.3.0" />
2929
</ItemGroup>
3030

31+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
32+
<DefineConstants>NETCORE</DefineConstants>
33+
</PropertyGroup>
34+
35+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net451' OR '$(TargetFramework)' == 'net452' OR '$(TargetFramework)' == 'net46' ">
36+
<DefineConstants>NETFULL</DefineConstants>
37+
</PropertyGroup>
38+
3139
</Project>

Src/CoreConsoleApp/Program.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,11 @@ namespace CoreConsoleApp
1717
{
1818
public class Program
1919
{
20-
21-
22-
2320
static void Main(string[] args)
2421
{
2522
var builder = new ConfigurationBuilder()
2623
.SetBasePath(Directory.GetCurrentDirectory())
27-
.AddJsonFile("appsettings.json", optional: true,
28-
reloadOnChange: true);
24+
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
2925

3026
var config = builder.Build();
3127
config.ConfigureStackifyLogging();

Src/CoreWebApp/CoreWebApp.csproj

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp1.0</TargetFramework>
4+
<TargetFramework>netcoreapp2.0</TargetFramework>
55
<PreserveCompilationContext>true</PreserveCompilationContext>
66
<AssemblyName>CoreWebApp</AssemblyName>
77
<OutputType>Exe</OutputType>
88
<PackageId>CoreWebApp</PackageId>
9-
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
10-
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
9+
<RuntimeFrameworkVersion>2.0.0</RuntimeFrameworkVersion>
1110
</PropertyGroup>
1211

1312
<ItemGroup>
@@ -25,22 +24,26 @@
2524
</ItemGroup>
2625

2726
<ItemGroup>
28-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.3" />
29-
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.0.3" />
30-
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.2" />
31-
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.3" />
32-
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.0.2" />
33-
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="1.0.2" />
34-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.0.2" />
35-
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.0.2" />
36-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.0.2" />
37-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.0.2" />
38-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.0.2" />
39-
<PackageReference Include="NLog" Version="5.0.0-beta05" />
40-
<PackageReference Include="NLog.Extensions.Logging" Version="1.0.0-rtm-beta2" />
27+
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.1" />
28+
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3" />
29+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.0.1" />
30+
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.0.1" />
31+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" />
32+
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.0.0" />
33+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
34+
<PackageReference Include="NLog" Version="4.5.0" />
35+
<PackageReference Include="NLog.Extensions.Logging" Version="1.0.0-rtm-rc4" />
4136
<PackageReference Include="Serilog" Version="2.4.0" />
4237
<PackageReference Include="Serilog.Extensions.Logging" Version="1.4.0" />
4338
<PackageReference Include="Serilog.Extensions.Logging.File" Version="1.0.0" />
4439
</ItemGroup>
40+
41+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
42+
<DefineConstants>NETCORE</DefineConstants>
43+
</PropertyGroup>
44+
45+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net451' OR '$(TargetFramework)' == 'net452' OR '$(TargetFramework)' == 'net46' ">
46+
<DefineConstants>NETFULL</DefineConstants>
47+
</PropertyGroup>
4548

4649
</Project>

Src/NLog.Targets.Stackify/NLog.Targets.Stackify.csproj

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<PropertyGroup>
44
<AssemblyTitle>NLog.Targets.Stackify</AssemblyTitle>
5-
<VersionPrefix>2.0.0-beta1</VersionPrefix>
6-
<TargetFrameworks>netstandard1.3;net40;net45</TargetFrameworks>
5+
<VersionPrefix>2.0.0</VersionPrefix>
6+
<TargetFrameworks>netstandard2.0;net40;net45;net451;net452;net46</TargetFrameworks>
77
<AssemblyName>NLog.Targets.Stackify</AssemblyName>
88
<PackageId>NLog.Targets.Stackify</PackageId>
99
<PackageTags>stackify;errors;logs</PackageTags>
@@ -15,26 +15,29 @@
1515
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
1616
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
1717
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
18+
<Version>2.1.1</Version>
19+
<PackageLicenseUrl>https://github.com/stackify/stackify-api-dotnet/blob/master/LICENSE</PackageLicenseUrl>
20+
<PackageProjectUrl>https://github.com/stackify/stackify-api-dotnet</PackageProjectUrl>
21+
<PackageIconUrl>https://stackify.com/wp-content/uploads/2017/02/stk.png</PackageIconUrl>
22+
<RepositoryUrl>https://github.com/stackify/stackify-api-dotnet</RepositoryUrl>
23+
<RepositoryType>git</RepositoryType>
1824
</PropertyGroup>
1925

2026
<ItemGroup>
2127
<ProjectReference Include="..\StackifyLib\StackifyLib.csproj" />
2228
</ItemGroup>
29+
30+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
31+
<DefineConstants>NETCORE</DefineConstants>
32+
</PropertyGroup>
2333

24-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
25-
<PackageReference Include="NLog" Version="5.0.0-beta05" />
26-
</ItemGroup>
27-
28-
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
29-
<PackageReference Include="NLog" Version="4.3.11" />
30-
<Reference Include="System" />
34+
<ItemGroup>
35+
<PackageReference Include="NLog" Version="4.5.0" />
3136
<Reference Include="Microsoft.CSharp" />
3237
</ItemGroup>
3338

34-
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
35-
<PackageReference Include="NLog" Version="4.3.11" />
36-
<Reference Include="System" />
37-
<Reference Include="Microsoft.CSharp" />
38-
</ItemGroup>
39+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net451' OR '$(TargetFramework)' == 'net452' OR '$(TargetFramework)' == 'net46' ">
40+
<DefineConstants>NETFULL</DefineConstants>
41+
</PropertyGroup>
3942

4043
</Project>

Src/NLog.Targets.Stackify/Properties/AssemblyInfo.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
using System.Runtime.CompilerServices;
33
using System.Runtime.InteropServices;
44

5-
// General Information about an assembly is controlled through the following
5+
// General Information about an assembly is controlled through the following
66
// set of attributes. Change these attribute values to modify the information
77
// associated with an assembly.
88
[assembly: AssemblyTitle("NLog.Targets.Stackify")]
9-
[assembly: AssemblyDescription("")]
9+
[assembly: AssemblyDescription("NLog.Targets.Stackify")]
1010
[assembly: AssemblyConfiguration("")]
11-
[assembly: AssemblyCompany("")]
11+
[assembly: AssemblyCompany("Stackify")]
1212
[assembly: AssemblyProduct("NLog.Targets.Stackify")]
1313
[assembly: AssemblyCopyright("Copyright © 2015")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

17-
// Setting ComVisible to false makes the types in this assembly not visible
18-
// to COM components. If you need to access a type in this assembly from
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
1919
// COM, set the ComVisible attribute to true on that type.
2020
[assembly: ComVisible(false)]
2121

@@ -25,12 +25,12 @@
2525
// Version information for an assembly consists of the following four values:
2626
//
2727
// Major Version
28-
// Minor Version
28+
// Minor Version
2929
// Build Number
3030
// Revision
3131
//
32-
// You can specify all the values or you can default the Build and Revision Numbers
32+
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.18.1.0")]
36-
[assembly: AssemblyFileVersion("1.18.1.0")]
35+
[assembly: AssemblyVersion("2.1.1.0")]
36+
[assembly: AssemblyFileVersion("2.1.1.0")]

0 commit comments

Comments
 (0)