use of com.evolveum.midpoint.xml.ns._public.common.common_3.LoggingConfigurationType in project midpoint by Evolveum.
the class LoggingConfigurationManager method prepareCommonAppenderHeader.
private static void prepareCommonAppenderHeader(StringBuilder sb, AppenderConfigurationType appender, LoggingConfigurationType config, String appenderClass) {
sb.append("\t<appender name=\"").append(appender.getName()).append("\" class=\"" + appenderClass + "\">\n");
//Apply profiling appender filter if necessary
if (IDM_PROFILE_APPENDER.equals(appender.getName())) {
for (ClassLoggerConfigurationType cs : config.getClassLogger()) {
if (REQUEST_FILTER_LOGGER_CLASS_NAME.equals(cs.getPackage()) || PROFILING_ASPECT_LOGGER.endsWith(cs.getPackage())) {
LOGGER.debug("Defining ProfilingLogbackFilter to {} appender.", appender.getName());
sb.append(defineProfilingLogbackFilter());
}
}
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.LoggingConfigurationType in project midpoint by Evolveum.
the class SystemConfigurationDto method getNewObject.
public SystemConfigurationType getNewObject() throws DatatypeConfigurationException {
SystemConfigurationType newObject = oldObject.clone();
if (StringUtils.isNotBlank(getPassPolicyDto().getOid())) {
ObjectReferenceType globalPassPolicyRef = ObjectTypeUtil.createObjectRef(getPassPolicyDto().getOid(), ObjectTypes.PASSWORD_POLICY);
newObject.setGlobalPasswordPolicyRef(globalPassPolicyRef);
} else {
newObject.setGlobalPasswordPolicyRef(null);
}
if (StringUtils.isNotBlank(getSecurityPolicyDto().getOid())) {
ObjectReferenceType globalSecurityPolicyRef = ObjectTypeUtil.createObjectRef(getSecurityPolicyDto().getOid(), WebComponentUtil.createPolyFromOrigString(getSecurityPolicyDto().getName()), ObjectTypes.SECURITY_POLICY);
newObject.setGlobalSecurityPolicyRef(globalSecurityPolicyRef);
} else {
newObject.setGlobalSecurityPolicyRef(null);
}
AssignmentPolicyEnforcementType globalAEP = AEPlevel.toAEPValueType(getAepLevel());
if (globalAEP != null) {
ProjectionPolicyType projectionPolicy = new ProjectionPolicyType();
projectionPolicy.setAssignmentPolicyEnforcement(globalAEP);
newObject.setGlobalAccountSynchronizationSettings(projectionPolicy);
}
Duration auditCleanupDuration = DatatypeFactory.newInstance().newDuration(getAuditCleanupValue());
Duration cleanupTaskDuration = DatatypeFactory.newInstance().newDuration(getTaskCleanupValue());
CleanupPolicyType auditCleanup = new CleanupPolicyType();
CleanupPolicyType taskCleanup = new CleanupPolicyType();
auditCleanup.setMaxAge(auditCleanupDuration);
taskCleanup.setMaxAge(cleanupTaskDuration);
CleanupPoliciesType cleanupPolicies = new CleanupPoliciesType();
cleanupPolicies.setAuditRecords(auditCleanup);
cleanupPolicies.setClosedTasks(taskCleanup);
newObject.setCleanupPolicy(cleanupPolicies);
SystemConfigurationTypeUtil.setEnableExperimentalCode(newObject, getEnableExperimentalCode());
newObject.setLogging(loggingConfig.getNewObject());
newObject.setNotificationConfiguration(notificationConfig.getNewObject(newObject));
newObject.setProfilingConfiguration(profilingDto.getNewObject());
ClassLoggerConfigurationType profilingClassLogger = profilingDto.getProfilingClassLogerConfig();
if (newObject.getLogging() != null) {
newObject.getLogging().getClassLogger().add(profilingClassLogger);
} else {
LoggingConfigurationType profLogging = new LoggingConfigurationType();
profLogging.getClassLogger().add(profilingClassLogger);
newObject.setLogging(profLogging);
}
return newObject;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.LoggingConfigurationType in project midpoint by Evolveum.
the class SubSystemLoggersMenuLinkCounter method count.
@Override
public int count(AssignmentHolderDetailsModel<SystemConfigurationType> model, PageBase pageBase) {
SystemConfigurationType object = model.getObjectType();
LoggingConfigurationType lg = object.getLogging();
return lg != null ? lg.getSubSystemLogger().size() : 0;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.LoggingConfigurationType in project midpoint by Evolveum.
the class LoggingDto method init.
private void init(LoggingConfigurationType config) {
if (config == null) {
return;
}
rootLevel = config.getRootLoggerLevel();
rootAppender = config.getRootLoggerAppender();
for (SubSystemLoggerConfigurationType logger : config.getSubSystemLogger()) {
filters.add(new FilterConfiguration(logger));
}
AuditingConfigurationType auditing = config.getAuditing();
if (auditing != null) {
setAuditLog(auditing.isEnabled());
setAuditDetails(auditing.isDetails());
setAuditAppender(auditing.getAppender() != null && auditing.getAppender().size() > 0 ? auditing.getAppender().get(0) : null);
}
for (ClassLoggerConfigurationType logger : config.getClassLogger()) {
if (ProfilingDto.LOGGER_PROFILING.equals(logger.getPackage())) {
continue;
}
if (componentMap.containsKey(logger.getPackage())) {
loggers.add(new ComponentLogger(logger));
} else if (StandardLogger.isStandardLogger(logger.getPackage())) {
loggers.add(new StandardLogger(logger));
} else {
loggers.add(new ClassLogger(logger));
}
}
Collections.sort(loggers, new Comparator<LoggerConfiguration>() {
@Override
public int compare(LoggerConfiguration l1, LoggerConfiguration l2) {
return String.CASE_INSENSITIVE_ORDER.compare(l1.getName(), l2.getName());
}
});
Collections.sort(filters, new Comparator<FilterConfiguration>() {
@Override
public int compare(FilterConfiguration f1, FilterConfiguration f2) {
return String.CASE_INSENSITIVE_ORDER.compare(f1.getName(), f2.getName());
}
});
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.LoggingConfigurationType in project midpoint by Evolveum.
the class LoggingDto method getNewObject.
public LoggingConfigurationType getNewObject() {
LoggingConfigurationType configuration = new LoggingConfigurationType();
AuditingConfigurationType audit = new AuditingConfigurationType();
audit.setEnabled(isAuditLog());
audit.setDetails(isAuditDetails());
if (StringUtils.isNotEmpty(getAuditAppender())) {
audit.getAppender().add(getAuditAppender());
}
configuration.setAuditing(audit);
configuration.setRootLoggerAppender(getRootAppender());
configuration.setRootLoggerLevel(getRootLevel());
for (AppenderConfiguration item : getAppenders()) {
configuration.getAppender().add(item.getConfig());
}
for (LoggerConfiguration item : getLoggers()) {
for (ClassLoggerConfigurationType logger : configuration.getClassLogger()) {
if (logger.getPackage().equals(item.getName())) {
throw new IllegalStateException("Logger with name '" + item.getName() + "' is already defined.");
}
}
//TODO : clean up toXmlType() method.. getAppenders() in LogginConfiguration is empty by default..shouldn't it be null?
if (item.toXmlType() != null) {
configuration.getClassLogger().add(item.toXmlType());
}
}
for (FilterConfiguration item : getFilters()) {
for (SubSystemLoggerConfigurationType filter : configuration.getSubSystemLogger()) {
if (filter.getComponent().name().equals(item.getName())) {
throw new IllegalStateException("Filter with name '" + item.getName() + "' is already defined.");
}
}
configuration.getSubSystemLogger().add(item.toXmlType());
}
for (LoggerConfiguration logger : getLoggers()) {
logger.setEditing(false);
}
for (FilterConfiguration filter : getFilters()) {
filter.setEditing(false);
}
for (AppenderConfiguration appender : getAppenders()) {
appender.setEditing(false);
}
return configuration;
}
Aggregations