Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 70CBD200CB5 for ; Wed, 12 Jul 2017 13:57:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6F5FA165FE7; Wed, 12 Jul 2017 11:57:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B50BA165FCD for ; Wed, 12 Jul 2017 13:57:03 +0200 (CEST) Received: (qmail 13047 invoked by uid 500); 12 Jul 2017 11:57:02 -0000 Mailing-List: contact dev-help@syncope.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@syncope.apache.org Delivered-To: mailing list dev@syncope.apache.org Received: (qmail 13031 invoked by uid 99); 12 Jul 2017 11:57:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jul 2017 11:57:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 0D951188AC2 for ; Wed, 12 Jul 2017 11:57:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id u-mvrpCAzMoz for ; Wed, 12 Jul 2017 11:57:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id DB1DB62706 for ; Wed, 12 Jul 2017 11:57:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 6EF71E0237 for ; Wed, 12 Jul 2017 11:57:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 29E8B246F9 for ; Wed, 12 Jul 2017 11:57:00 +0000 (UTC) Date: Wed, 12 Jul 2017 11:57:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@syncope.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SYNCOPE-1144) Customizable Audit appender MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 12 Jul 2017 11:57:04 -0000 [ https://issues.apache.org/jira/browse/SYNCOPE-1144?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16= 083867#comment-16083867 ]=20 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 =20 --- Diff: core/logic/src/main/java/org/apache/syncope/core/logic/Logger= Logic.java --- @@ -216,10 +228,71 @@ private LoggerTO setLevel(final String name, fina= l Level level, final LoggerType syncopeLogger.setLevel(LoggerLevel.fromLevel(level)); syncopeLogger =3D loggerDAO.save(syncopeLogger); =20 + boolean isAudit =3D LoggerType.AUDIT.equals(syncopeLogger.getT= ype()); LoggerContext ctx =3D (LoggerContext) LogManager.getContext(fa= lse); + String domainAuditLoggerName =3D + AuditManagerImpl.getDomainAuditEventLoggerName(AuthCon= textUtils.getDomain(), syncopeLogger. + getKey()); LoggerConfig logConf =3D SyncopeConstants.ROOT_LOGGER.equals(n= ame) ? ctx.getConfiguration().getLoggerConfig(LogManager.RO= OT_LOGGER_NAME) - : ctx.getConfiguration().getLoggerConfig(name); + : isAudit + ? ctx.getConfiguration().getLoggerConfig(domai= nAuditLoggerName) + : ctx.getConfiguration().getLoggerConfig(name)= ; + + if (isAudit) { + // SYNCOPE-1144 For each custom audit appender class add r= elated appenders to log4j logger --- End diff -- =20 Isn't this code a copy of what inserted in `LoggerLoader`? If so, pleas= e extract it into a public method in `LoggerLoader` and invoke that from he= re 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=C3=B2 > Assignee: Andrea Patricelli > Fix For: 2.0.5, 2.1.0 > > > The Audit mechanism is based on LOG4J, configured to use the {{JDBCAppend= er}} to store the audit statements into the {{SyncopeAudit}} table in the i= nternal storage. > Besides this base mechanism, we can introduce the {{AuditAppender}} inter= face, 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 f= ormat more suitable to the target appender -- This message was sent by Atlassian JIRA (v6.4.14#64029)