/** * Return the appropriate {@code Log} instance to use for the given * {@code MethodInvocation}. If the {@code useDynamicLogger} flag * is set, the {@code Log} instance will be for the target class of the * {@code MethodInvocation}, otherwise the {@code Log} will be the * default static logger. * @param invocation the {@code MethodInvocation} being traced * @return the {@code Log} instance to use * @see #setUseDynamicLogger */ protected Log getLoggerForInvocation(MethodInvocation invocation) { if (this.defaultLogger != null) { return this.defaultLogger; } else { Object target = invocation.getThis(); return LogFactory.getLog(getClassForLogging(target)); } }
/** * Return the appropriate {@code Log} instance to use for the given * {@code MethodInvocation}. If the {@code useDynamicLogger} flag * is set, the {@code Log} instance will be for the target class of the * {@code MethodInvocation}, otherwise the {@code Log} will be the * default static logger. * @param invocation the {@code MethodInvocation} being traced * @return the {@code Log} instance to use * @see #setUseDynamicLogger */ protected Log getLoggerForInvocation(MethodInvocation invocation) { if (this.defaultLogger != null) { return this.defaultLogger; } else { Object target = invocation.getThis(); return LogFactory.getLog(getClassForLogging(target)); } }
/** * Return the appropriate {@code Log} instance to use for the given * {@code MethodInvocation}. If the {@code useDynamicLogger} flag * is set, the {@code Log} instance will be for the target class of the * {@code MethodInvocation}, otherwise the {@code Log} will be the * default static logger. * @param invocation the {@code MethodInvocation} being traced * @return the {@code Log} instance to use * @see #setUseDynamicLogger */ protected Log getLoggerForInvocation(MethodInvocation invocation) { if (this.defaultLogger != null) { return this.defaultLogger; } else { Object target = invocation.getThis(); return LogFactory.getLog(getClassForLogging(target)); } }