<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi all,</p>
<p><br>
</p>
<p>I am configuring a custom audit logger that dumps some application specific data in addition to what midPoint logs out of the box. The Java classes were easy enough to implement, but I am having problems getting the logger log where I want it to.</p>
<p><br>
</p>
<p>I want logging to start without administrator intervention at startup, so I took the logback.xml file from midPoint distribution and added the following:</p>
<p><br>
</p>
<p>    <appender name="KVH-AUDIT_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender"><br>
        <Append>true</Append><br>
        <File>${catalina.base}/logs/kvh-audit.log</File><br>
        <encoder><br>
            <pattern>%msg%n</pattern><br>
        </encoder><br>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"><br>
            <fileNamePattern>${catalina.base}/logs/idm-profile-%d{yyyy-MM-dd}.%i.log</fileNamePattern><br>
            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"><br>
                <maxFileSize>100MB</maxFileSize><br>
            </timeBasedFileNamingAndTriggeringPolicy><br>
            <maxHistory>10</maxHistory><br>
        </rollingPolicy><br>
    </appender><br>
</p>
<p><br>
</p>
<p>    <logger name="KVH-AUDIT" level="INFO"><br>
        <appender-ref ref="KVH-AUDIT_LOG"/><br>
    </logger></p>
<p><br>
</p>
<p>Before tomcat is started, the midpoint.war archive is updated so that the original WEB-INF/classes/logback.xml is replaced by the modified file.
<br>
</p>
<p><br>
</p>
<p>When midPoint starts, I get log lines in kvh-audit.log as expected, but then I get the following in idm.log:</p>
<p><br>
</p>
<p>2017-04-05 10:49:43,414 [] [localhost-startStop-1] INFO (com.evolveum.midpoint.common.LoggingConfigurationManager): Applying logging configuration (version 0)<br>
2017-04-05 10:49:43,417 [] [localhost-startStop-1] INFO (com.evolveum.midpoint.common.LoggingConfigurationManager): Resetting current logging configuration<br>
2017-04-05 10:49:43,496 [] [localhost-startStop-1] INFO (com.evolveum.midpoint.common.LoggingConfigurationManager): New logging configuration applied</p>
<p><br>
</p>
<p>After this, the KVH-AUDIT logger no longer appends to kvh-audit.log, even though the log lines continue to appear in idm.log. I don't understand where LoggingConfigurationManager finds the new logging configuration, and why it forgets the KVH-AUDIT_LOG appender
 but not the KVH-AUDIT logger.</p>
<p><br>
</p>
<p>Tia, Pertti</p>
<p><br>
</p>
</body>
</html>