private static ContextInfoForStack FillContextInfoStruct(HeContext context) { ContextInfoForStack contextForStack = new ContextInfoForStack(); if (context != null) { try { contextForStack.sessionId = context.Session.SessionID; } catch { } try { contextForStack.userId = context.Session.UserId; } catch { } try { contextForStack.username = context.Session.UserName; } catch { } try { if (context.RequestTracer != null) { RequestTracer requestTracer = context.RequestTracer; contextForStack.requestKey = requestTracer.RequestKey; contextForStack.actionName = requestTracer.EntryActionName; contextForStack.entryPointName = requestTracer.EntryEndpointName; requestTracer.RegisterError(); } } catch { } try { contextForStack.requestUrl = context.Context.Request.Url.ToString(); } catch { } try { contextForStack.requestMethod = context.Context.Request.HttpMethod; } catch { } try { contextForStack.requestQuery = context.Context.Request.QueryString != null?context.Context.Request.QueryString.ToString() : ""; } catch { } try { contextForStack.currentLocale = context.CurrentLocale; } catch { } try { contextForStack.clientIp = RuntimePlatformUtils.GetClientIpForLogging(); } catch { } try { contextForStack.deviceUuid = RuntimePlatformUtils.GetDeviceUuidForLogging(); } catch { } try { contextForStack.CurrentExecutionFileName = context.CurrentExecutionFileName; } catch { } } return(contextForStack); }