syncope-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SYNCOPE-1144) Customizable Audit appender
Date Wed, 12 Jul 2017 11:57:00 GMT

    [ https://issues.apache.org/jira/browse/SYNCOPE-1144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16083867#comment-16083867
] 

ASF GitHub Bot commented on SYNCOPE-1144:
-----------------------------------------

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.


> Customizable Audit appender
> ---------------------------
>
>                 Key: SYNCOPE-1144
>                 URL: https://issues.apache.org/jira/browse/SYNCOPE-1144
>             Project: Syncope
>          Issue Type: New Feature
>          Components: common, console, core
>            Reporter: Francesco Chicchiriccò
>            Assignee: Andrea Patricelli
>             Fix For: 2.0.5, 2.1.0
>
>
> The Audit mechanism is based on LOG4J, configured to use the {{JDBCAppender}} to store
the audit statements into the {{SyncopeAudit}} table in the internal storage.
> Besides this base mechanism, we can introduce the {{AuditAppender}} interface, whose
instances can:
> # declare which event(s) they will be invoked with
> # declare another LOG4J appender to send the statements to (besides the {{JDBCAppender}}
as above)
> # optionally offer the ability to transform the standard statement to a format more suitable
to the target appender



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message