<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi Pertti,</p>
    <p><br>
    </p>
    <p>after midpoint loads System Configuration object, logging
      configuration is applied from there. Maybe this is the problem.<br>
    </p>
    <p><br>
    </p>
    <p>Maybe this helps:</p>
    <p><a class="moz-txt-link-freetext" href="https://wiki.evolveum.com/display/midPoint/Initial+Logging+Setup+HOWTO">https://wiki.evolveum.com/display/midPoint/Initial+Logging+Setup+HOWTO</a></p>
    <p><br>
    </p>
    <p>Regards,</p>
    <p>Ivan<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 04/05/2017 02:08 PM, Pertti
      Kellomäki wrote:<br>
    </div>
    <blockquote cite="mid:1491394134909.43403@datactica.fi" type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} --></style>
      <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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Ivan Noris
Senior Identity Engineer
evolveum.com
</pre>
  </body>
</html>