File tree Expand file tree Collapse file tree 3 files changed +37
-4
lines changed
Src/StackifyLib.log4net.Sitecore Expand file tree Collapse file tree 3 files changed +37
-4
lines changed Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
22<packages >
3- <package id =" log4net" version =" 2.0.10 " targetFramework =" net40" />
3+ <package id =" log4net" version =" 2.0.11 " targetFramework =" net40" />
44</packages >
Original file line number Diff line number Diff line change @@ -41,19 +41,37 @@ static void Main(string[] args)
4141 Console . WriteLine ( $ "Stackify Config EnvironmentName: { StackifyLib . Config . Environment } ") ;
4242 Console . WriteLine ( $ "Stackify Config ApiKey: { StackifyLib . Config . ApiKey } ") ;
4343
44- StackifyLib . ProfileTracer . SetApplicationName ( "Test Name" ) ;
45- StackifyLib . ProfileTracer . SetEnvironmentName ( "Test Environment" ) ;
44+ StackifyLib . ProfileTracer . SetApplicationName ( "Test Name 2 " ) ;
45+ StackifyLib . ProfileTracer . SetEnvironmentName ( "Test Environment 2 " ) ;
4646
4747 var tracer = StackifyLib . ProfileTracer . CreateAsOperation ( "Operation Name" , Trace . CorrelationManager . ActivityId . ToString ( ) ) ;
4848 tracer . Exec ( ( ) => //FYI, async code is also supported via tracer.ExecAsync()
4949 {
5050 //Do some stuff here
5151 Task . Delay ( 1000 ) . GetAwaiter ( ) . GetResult ( ) ;
52+ Console . WriteLine ( $ "StackifyLib Operation") ;
5253 } ) ;
54+
55+ StackifyLib . ProfileTracer . SetApplicationName ( "Test Name 3" ) ;
56+ StackifyLib . ProfileTracer . SetEnvironmentName ( "Test Environment 3" ) ;
57+
58+ TestInstrument ( ) ;
5359 StackifyLib . Logger . Shutdown ( ) ; //best practice for console apps
5460 Console . ReadLine ( ) ;
5561 }
5662
63+ private static void TestInstrument ( )
64+ {
65+ Task . Delay ( 1000 ) . GetAwaiter ( ) . GetResult ( ) ;
66+ Console . WriteLine ( $ "Custom Operation") ;
67+ TestInstrumentNested ( ) ;
68+ }
69+
70+ private static void TestInstrumentNested ( )
71+ {
72+ Task . Delay ( 1000 ) . GetAwaiter ( ) . GetResult ( ) ;
73+ Console . WriteLine ( $ "Custom Operation Nested") ;
74+ }
5775
5876 private static void NLogTest ( )
5977 {
Original file line number Diff line number Diff line change 11{
22 "AppName" : " CoreConsoleApp_stackifyjson" ,
33 "Environment" : " Dev_stackifyjson" ,
4- "ApiKey" : " sampleKey_stackifyjson"
4+ "ApiKey" : " sampleKey_stackifyjson" ,
5+ "EnableDebugging" : true ,
6+ "Instrumentation" : [
7+ {
8+ "Assembly" : " CoreConsoleApp" ,
9+ "Class" : " CoreConsoleApp.Program" ,
10+ "Method" : " TestInstrument" ,
11+ "StartTrace" : true
12+ },
13+ {
14+ "Assembly" : " CoreConsoleApp" ,
15+ "Class" : " CoreConsoleApp.Program" ,
16+ "Method" : " TestInstrumentNested" ,
17+ "StartTrace" : true
18+ }
19+ ]
520}
You can’t perform that action at this time.
0 commit comments