SUPPORT-8706: fixes
This commit is contained in:
parent
2bd7ff19d7
commit
ee7914a60f
1 changed files with 1 additions and 13 deletions
|
|
@ -1,7 +1,5 @@
|
|||
package ru.micord.ervu.audit.config;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.annotation.Condition;
|
||||
import org.springframework.context.annotation.ConditionContext;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
|
@ -11,21 +9,11 @@ import org.springframework.core.type.AnnotatedTypeMetadata;
|
|||
* @author Adel Kalimullin
|
||||
*/
|
||||
public class AuditEnabledCondition implements Condition {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(AuditEnabledCondition.class);
|
||||
private static final String AUDIT_ENABLED_PROPERTY_NAME = "audit.kafka.enabled";
|
||||
|
||||
@Override
|
||||
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
|
||||
Environment env = context.getEnvironment();
|
||||
boolean isEnabled = Boolean.parseBoolean(env.getProperty(AUDIT_ENABLED_PROPERTY_NAME));
|
||||
|
||||
if (isEnabled) {
|
||||
LOGGER.info("Audit is enabled.");
|
||||
}
|
||||
else {
|
||||
LOGGER.info("Audit is disabled.");
|
||||
}
|
||||
|
||||
return isEnabled;
|
||||
return Boolean.parseBoolean(env.getProperty(AUDIT_ENABLED_PROPERTY_NAME));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue