Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/52#discussion_r126933815
  
    --- 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 --
    
    Isn't this code a copy of what inserted in `LoggerLoader`? If so, please 
extract it into a public method in `LoggerLoader` and invoke that from here too.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to