예제 #1
0
        /// <summary>
        /// 返回logger
        /// </summary>
        /// <param name="runtimeModeProvider">环境运行提供者,如果为空则不写,如有需要,则重写该方法则可</param>
        /// <param name="loggerBuilder">日志构建者</param>
        /// <param name="executor">执行者</param>
        /// <param name="exception">异常信息</param>
        /// <param name="context">上下文</param>
        protected virtual ILogger GetLogger(IRuntimeModeProvider runtimeModeProvider, ILoggerBuilder loggerBuilder, object executor, Exception exception, object context)
        {
            if (loggerBuilder == null)
            {
                return(null);
            }

            if (executor == null)
            {
                return(loggerBuilder.Build(typeof(LoggerAttribute)));
            }

            return(loggerBuilder.Build(executor.GetType()));
        }