syncope-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrea-patricelli <...@git.apache.org>
Subject [GitHub] syncope pull request #52: [SYNCOPE-1144] configurable audit appenders with m...
Date Wed, 12 Jul 2017 15:07:29 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message