Skip to content

Commit 6e26ba0

Browse files
Merge branch 'master' into develop
2 parents fb0d36c + 7049879 commit 6e26ba0

File tree

8 files changed

+140
-209
lines changed

8 files changed

+140
-209
lines changed

README.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ 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/)
10+
- [Stackify documentation site](https://docs.stackify.com/docs)
1111
- [NuGet packages](https://www.nuget.org/packages?q=Stackify)
12+
- [Configure log4net](https://docs.stackify.com/docs/errors-and-logs-log4net)
1213
- [Best practices for logging with C#](https://stackify.com/csharp-logging-best-practices/)
1314
- [Why you should use tags in your logs](https://stackify.com/get-smarter-log-management-with-log-tags/)
15+
- [Ultimate log4net Tutorial for .Net Logging](https://stackify.com/log4net-guide-dotnet-logging/)
16+
1417

1518

1619
**Read me sections:**
@@ -91,7 +94,7 @@ static void StackifyAPILogger_OnLogMessage(string data)
9194
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.
9295

9396

94-
### NLog 2.0.1.2 - v3.1+
97+
### NLog 4.5
9598

9699
**Install via NuGet package**
97100
```
@@ -105,8 +108,10 @@ Sample config:
105108
<add assembly="NLog.Targets.Stackify"/>
106109
</extensions>
107110
<targets>
108-
<target name="stackify" type="StackifyTarget" globalContextKeys="examplekey1,key2"
109-
mappedContextKeys="" callContextKeys="" logMethodNames="true" />
111+
<target name="stackify" type="StackifyTarget" logAllParams="false">
112+
<contextproperty name="gdcKey1" layout="${gdc:item=gdcKey1}" />
113+
<contextproperty name="mdlcKey2" layout="${mdlc:item=mdlcKey2}" />
114+
</target>
110115
</targets>
111116
<rules>
112117
<logger name="*" writeTo="stackify" minlevel="Debug" />
@@ -124,11 +129,16 @@ dictionary["color"] = "red";
124129
nlog.Debug("Test message", dictionary);
125130
```
126131

127-
Options
132+
Options:
128133

129-
- GlobalContext and MappedContext keys are fully supported by setting the parameters in the config as a comma delimited list of keys. See sample config above.
130-
- 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.
131-
- 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.
134+
- IncludeEventProperties - Include LogEvent-Properties for structured logging.
135+
- IncludeMdlc - Include NLog MappedDiagnosticsLogicalContext MDLC-Properties for structured logging.
136+
- IncludeCallSite - Include LogEvent CallSite so method names will show up in the StackifyLog viewer (Replaces old property logMethodNames)
137+
- logLastParameter - Serialize the last parameter provided with the LogEvent.
138+
- logAllParams - Serialize all the parameters provided with the LogEvent (arg0, arg1, etc.)
139+
- GlobalContextKeys - Comma delimited list of keys for NLog GDC. !OBSOLETE! Instead use contextproperty-Layout as shown in sample config above.
140+
- MappedContextKeys - Comma delimited list of keys for NLog MDC. !OBSOLETE! Instead use contextproperty-Layout as shown in sample config above.
141+
- CallContextKeys - Comma delimited list of keys for use with CallContext.LogicalSetData(key, value). Research LogicalSetData online to learn more. !OBSOLETE! Instead use contextproperty-Layout as shown in sample config above.
132142

133143
### log4net v2.0+ (v1.2.11+)
134144

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<AssemblyTitle>NLog.Targets.Stackify</AssemblyTitle>
55
<VersionPrefix>2.0.0</VersionPrefix>
6-
<TargetFrameworks>netstandard2.0;net40;net45;net451;net452;net46</TargetFrameworks>
6+
<TargetFrameworks>netstandard2.0;net40;net45;net461</TargetFrameworks>
77
<AssemblyName>NLog.Targets.Stackify</AssemblyName>
88
<PackageId>NLog.Targets.Stackify</PackageId>
99
<PackageTags>stackify;errors;logs</PackageTags>
@@ -25,18 +25,14 @@
2525

2626
<ItemGroup>
2727
<ProjectReference Include="..\StackifyLib\StackifyLib.csproj" />
28+
<PackageReference Include="NLog" Version="4.5.0" />
2829
</ItemGroup>
2930

3031
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
3132
<DefineConstants>NETCORE</DefineConstants>
3233
</PropertyGroup>
3334

34-
<ItemGroup>
35-
<PackageReference Include="NLog" Version="4.5.0" />
36-
<Reference Include="Microsoft.CSharp" />
37-
</ItemGroup>
38-
39-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net451' OR '$(TargetFramework)' == 'net452' OR '$(TargetFramework)' == 'net46' ">
35+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net461' ">
4036
<DefineConstants>NETFULL</DefineConstants>
4137
</PropertyGroup>
4238

0 commit comments

Comments
 (0)