syncope-dev mailing list archives

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

Mime
View raw message