Example #1
0
        private string SerializeRequest(object value)
        {
            JsonSerializerOptions options = new JsonSerializerOptions()
            {
                PropertyNameCaseInsensitive = true
            };
            string json = JsonSerializer.Serialize(value);

            LogEventManager.Info($"JSON request sent: {json}");
            return(json);
        }
Example #2
0
        public void Sample()
        {
            var client = ClientHelper.GetSdkClient();


            LogEventManager.Verbose("This is a verbose message.");
            LogEventManager.Debug("This is a debug message.");
            LogEventManager.Info("This is a info message.");
            LogEventManager.Warn("This is a info message.");
            LogEventManager.Error("This is an error message.", new Sdk.Common.MetrikException("This is an ERROR exception test."));
            LogEventManager.Fatal("This is a fatal message", new Sdk.Common.MetrikException("This is a FATAL exception test."));

            // This is for checking if the logs are populated properly for each event type
            Assert.IsTrue(true);
        }
Example #3
0
        public override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            base.OnActionExecuted(filterContext);

            if (filterContext.Exception == null)
            {
                //save and destroy instance
                if (AppContext.UnitOfWork != null)
                {
                    AppContext.UnitOfWork.Save();
                }
            }

            //log user request
            var logmgr = new LogEventManager(_requestInfo);

            logmgr.Info("User Request", null, DateTime.Now.Subtract(_startAction).TotalSeconds);
        }