Exemplo n.º 1
0
        private static void HandleExceptioin(Exception ex, SkExceptionHandleAction action)
        {
            //No action
            if (action == SkExceptionHandleAction.None)
            {
                return;
            }

            //log exception
            if (action == SkExceptionHandleAction.LogAndRethrow)
            {
                var logger = SkServiceLocator.Get <SkLoggerBase>();
                if (logger != null)
                {
                    logger.LogError(ex);
                }
            }

            // throw current exception
            if (action == SkExceptionHandleAction.Rethrow || action == SkExceptionHandleAction.LogAndRethrow)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
            var logger = SkServiceLocator.Get <SkLoggerBase>();

            logger.LogAudit(_eventName, _detail, _properties);
        }