Exemple #1
0
 public void Intercept(IInvocation invocation)
 {
     try
     {
         invocation.Proceed();
     }
     catch (Exception ex)
     {
         appender.Error(handleException(ex));
     }
 }
Exemple #2
0
        public void Intercept(IInvocation invocation)
        {
            //Prior-invocation
            appender.Debug("Invoking {0}", GetMethodInformation(invocation));

            try
            {
                invocation.Proceed();
                //Post-invocation
                appender.Debug("{0} has finished. Returned {1}", invocation.Method.Name, invocation.ReturnValue);
            }
            catch (Exception ex)
            {
                //On exception
                appender.Error("Threw exception {0} . {1} ", ex.Message, GetMethodInformation(invocation));
                throw ex;
            }
        }
Exemple #3
0
        public void Intercept(IInvocation invocation)
        {
            //prior invocation
            auditor.Debug("Calling {0}", GetMethodInformation(invocation));

            try
            {
                invocation.Proceed();

                //post invocation
                auditor.Debug("Done: result was {0}.", invocation.ReturnValue);
            }
            catch (Exception ex)
            {
                //on exception
                auditor.Error("Threw exception {0} . {1} ", ex.Message, GetMethodInformation(invocation));
                throw ex;
            }
        }