Github user andrea-patricelli commented on a diff in the pull request: https://github.com/apache/syncope/pull/52#discussion_r126981510 --- Diff: core/logic/src/main/java/org/apache/syncope/core/logic/LoggerLogic.java --- @@ -216,10 +228,71 @@ private LoggerTO setLevel(final String name, final Level level, final LoggerType syncopeLogger.setLevel(LoggerLevel.fromLevel(level)); syncopeLogger = loggerDAO.save(syncopeLogger); + boolean isAudit = LoggerType.AUDIT.equals(syncopeLogger.getType()); LoggerContext ctx = (LoggerContext) LogManager.getContext(false); + String domainAuditLoggerName = + AuditManagerImpl.getDomainAuditEventLoggerName(AuthContextUtils.getDomain(), syncopeLogger. + getKey()); LoggerConfig logConf = SyncopeConstants.ROOT_LOGGER.equals(name) ? ctx.getConfiguration().getLoggerConfig(LogManager.ROOT_LOGGER_NAME) - : ctx.getConfiguration().getLoggerConfig(name); + : isAudit + ? ctx.getConfiguration().getLoggerConfig(domainAuditLoggerName) + : ctx.getConfiguration().getLoggerConfig(name); + + if (isAudit) { + // SYNCOPE-1144 For each custom audit appender class add related appenders to log4j logger --- End diff -- Yes, but there are differences from the two pieces of code. I refactored as much as possible, centralizing as much as possible code in `LoggerLoader`.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---