29 lines
764 B
C#
29 lines
764 B
C#
using Autofac.Extras.DynamicProxy;
|
|
using Castle.DynamicProxy;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace APT.API
|
|
{
|
|
[Intercept(typeof(LogInterceptor))]
|
|
public class LogInterceptor: IInterceptor
|
|
{
|
|
public void Intercept(IInvocation invocation)
|
|
{
|
|
try
|
|
{
|
|
invocation.Proceed();
|
|
var s = invocation.Method.Name;
|
|
//LogManager.logger.Info(invocation.Method.Name);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
var s = invocation.Method.Name;
|
|
//Dapper.Logger.LogHelper.logger.Error(invocation.Method.Name + " " + ex.ToString());
|
|
}
|
|
}
|
|
}
|
|
}
|