Search in sources :

Example 1 with LoggingConfigurationType

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());
            }
        }
    }
}
Also used : ClassLoggerConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ClassLoggerConfigurationType)

Example 2 with LoggingConfigurationType

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;
}
Also used : ObjectReferenceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType) CleanupPolicyType(com.evolveum.midpoint.xml.ns._public.common.common_3.CleanupPolicyType) LoggingConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.LoggingConfigurationType) AssignmentPolicyEnforcementType(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentPolicyEnforcementType) CleanupPoliciesType(com.evolveum.midpoint.xml.ns._public.common.common_3.CleanupPoliciesType) SystemConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType) Duration(javax.xml.datatype.Duration) ClassLoggerConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ClassLoggerConfigurationType) ProjectionPolicyType(com.evolveum.midpoint.xml.ns._public.common.common_3.ProjectionPolicyType)

Example 3 with LoggingConfigurationType

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;
}
Also used : LoggingConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.LoggingConfigurationType) SystemConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType)

Example 4 with LoggingConfigurationType

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());
        }
    });
}
Also used : AuditingConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.AuditingConfigurationType) ClassLoggerConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ClassLoggerConfigurationType) SubSystemLoggerConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.SubSystemLoggerConfigurationType)

Example 5 with LoggingConfigurationType

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;
}
Also used : AuditingConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.AuditingConfigurationType) LoggingConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.LoggingConfigurationType) ClassLoggerConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ClassLoggerConfigurationType) SubSystemLoggerConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.SubSystemLoggerConfigurationType)

Aggregations

ClassLoggerConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ClassLoggerConfigurationType)8 LoggingConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.LoggingConfigurationType)7 SystemConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType)4 SubSystemLoggerConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.SubSystemLoggerConfigurationType)3 AppenderConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.AppenderConfigurationType)2 AssignmentPolicyEnforcementType (com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentPolicyEnforcementType)2 AuditingConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.AuditingConfigurationType)2 CleanupPolicyType (com.evolveum.midpoint.xml.ns._public.common.common_3.CleanupPolicyType)2 FileAppenderConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.FileAppenderConfigurationType)2 BasePanel (com.evolveum.midpoint.gui.api.component.BasePanel)1 ItemHeaderPanel (com.evolveum.midpoint.gui.impl.prism.panel.ItemHeaderPanel)1 ItemPanelSettingsBuilder (com.evolveum.midpoint.gui.impl.prism.panel.ItemPanelSettingsBuilder)1 IntegrationTestTools (com.evolveum.midpoint.test.IntegrationTestTools)1 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)1 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)1 ObjectDeltaListType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType)1 ObjectDeltaOperationListType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType)1 CleanupPoliciesType (com.evolveum.midpoint.xml.ns._public.common.common_3.CleanupPoliciesType)1 ObjectPolicyConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectPolicyConfigurationType)1 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)1