@@ -38,6 +38,7 @@ public static void LoadSettings()
3838 try
3939 {
4040 if ( IsStackifyJsonLoaded == false ) {
41+ StackifyAPILogger . Log ( $ "#Config - LoadSettings - Stackify JSON - Read") ;
4142 ReadStackifyJSONConfig ( ) ; // TODO: Better way?
4243 }
4344
@@ -155,6 +156,15 @@ public static void LoadSettings()
155156 {
156157 StackifyAPILogger . Log ( "#Config #LoadSettings failed" , ex ) ;
157158 }
159+
160+ try
161+ {
162+ StackifyAPILogger . EvaluateLogEnabled ( ) ;
163+ }
164+ catch ( Exception ex )
165+ {
166+ StackifyAPILogger . Log ( "#Config #LoadSettings StackifyAPILogger.EvaluateLogEnabled failed" , ex ) ;
167+ }
158168 }
159169
160170 public static string ApiKey { get ; set ; }
@@ -299,7 +309,7 @@ public static void ReadStackifyJSONConfig()
299309 {
300310 try
301311 {
302- var ASPEnvironment = System . Environment . GetEnvironmentVariable ( "ASPNETCORE_ENVIRONMENT" ) ?? "Production" ;
312+ var ASPEnvironment = System . Environment . GetEnvironmentVariable ( "ASPNETCORE_ENVIRONMENT" ) ;
303313 var DotnetEnvironment = System . Environment . GetEnvironmentVariable ( "DOTNET_ENVIRONMENT" ) ;
304314 string baseDirectory = Path . GetDirectoryName ( Assembly . GetExecutingAssembly ( ) . Location ) ;
305315 string jsonPath = string . Empty ;
@@ -318,6 +328,7 @@ public static void ReadStackifyJSONConfig()
318328 jsonPath = Path . Combine ( baseDirectory , "Stackify.json" ) ;
319329 }
320330
331+ StackifyAPILogger . Log ( $ "#Config #Json Load - Path: { jsonPath } ") ;
321332 if ( File . Exists ( jsonPath ) )
322333 {
323334 using ( var fs = new FileStream ( jsonPath , FileMode . Open , FileAccess . Read , FileShare . ReadWrite ) )
@@ -350,6 +361,7 @@ public static void ReadStackifyJSONConfig()
350361 iisJsonPath = Path . Combine ( iisBaseDirectory , "Stackify.json" ) ;
351362 }
352363
364+ StackifyAPILogger . Log ( $ "#Config #Json Load - Path: { iisJsonPath } ") ;
353365 if ( File . Exists ( iisJsonPath ) )
354366 {
355367 using ( var fs = new FileStream ( iisJsonPath , FileMode . Open , FileAccess . Read , FileShare . ReadWrite ) )
@@ -427,6 +439,7 @@ public static void SetStackifyObj(JObject obj)
427439 AppName = TryGetValue ( obj , "AppName" ) ?? AppName ;
428440 Environment = TryGetValue ( obj , "Environment" ) ?? Environment ;
429441 ApiKey = TryGetValue ( obj , "ApiKey" ) ?? ApiKey ;
442+ StackifyAPILogger . Log ( $ "#Config #Json #SetStackifyObj Load - AppName: { AppName } - Environment: { Environment } - ApiKey: { ApiKey } ") ;
430443 }
431444
432445 private static string TryGetValue ( JToken jToken , string key )
@@ -449,6 +462,7 @@ private static string TryGetValue(JToken jToken, string key)
449462 }
450463
451464 r = val . ToString ( ) ;
465+ StackifyAPILogger . Log ( $ "#Config #TryGetValue #Json Success - Key: { key } - Value: { r ?? "Empty" } ") ;
452466 }
453467 catch ( Exception ex )
454468 {
0 commit comments