<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2010-2017 Evolveum
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<systemConfiguration oid="00000000-0000-0000-0000-000000000001" version="0"
                     xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
                     xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
                     xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3">
    <name>SystemConfiguration</name>
    <globalSecurityPolicyRef oid="24bd8e70-5cc5-11e7-b20d-67ebcbf174d3"/>
    <logging>
        <classLogger>
            <level>ERROR</level>
            <package>ro.isdc.wro.extensions.processor.css.Less4jProcessor</package>
        </classLogger>
        <classLogger>
            <!-- disabled because of MID-744, helper insert messages on ERROR
            level which should not be there (probably should be on TRACE) -->
            <level>OFF</level>
            <package>org.hibernate.engine.jdbc.spi.SqlExceptionHelper</package>
        </classLogger>
        <!-- Disabled because we treat locking-related exceptions in the repository.
             Otherwise the log is filled-in with (innocent but ugly-looking) messages like
             "ERROR (o.h.engine.jdbc.batch.internal.BatchingBatch): HHH000315: Exception executing batch [Deadlock detected.
             The current transaction was rolled back." -->
        <classLogger>
            <level>OFF</level>
            <package>org.hibernate.engine.jdbc.batch.internal.BatchingBatch</package>
        </classLogger>
        <!-- Disabled because of the same reason; this time concerning messages like
             "INFO (org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl):
             HHH000010: On release of batch it still contained JDBC statements" -->
        <classLogger>
            <level>WARN</level>
            <package>org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl</package>
        </classLogger>
        <classLogger>
            <!-- disabled because of MID-1612, jasper library needs to be fixed -->
            <level>OFF</level>
            <package>net.sf.jasperreports.engine.fill.JRFillDataset</package>
        </classLogger>
        <classLogger>
            <!-- disabled because we don't need to see every property file
            loading message (unnecessary log pollution) -->
            <level>WARN</level>
            <package>org.apache.wicket.resource.PropertiesFactory</package>
        </classLogger>
        <classLogger>
            <!-- Standard useful logger -->
            <level>INFO</level>
            <package>com.evolveum.midpoint.model.impl.lens.projector.Projector</package>
        </classLogger>
        <classLogger>
            <!-- Standard useful logger -->
            <level>INFO</level>
            <package>com.evolveum.midpoint.model.impl.lens.Clockwork</package>
        </classLogger>

        <appender xsi:type="c:FileAppenderConfigurationType" name="IDM_LOG"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <pattern>%date [%X{subsystem}] [%thread] %level \(%logger\): %msg%n</pattern>
            <fileName>${catalina.base}/logs/idm.log</fileName>
            <filePattern>${catalina.base}/logs/idm-%d{yyyy-MM-dd}.%i.log</filePattern>
            <maxHistory>10</maxHistory>
            <maxFileSize>100MB</maxFileSize>
            <append>true</append>
        </appender>
        <!-- Appender for profiling purposes -->
        <appender xsi:type="c:FileAppenderConfigurationType" name="IDM-PROFILE_LOG"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <pattern>%date %level: %msg%n</pattern>
            <fileName>${catalina.base}/logs/idm-profile.log</fileName>
            <filePattern>${catalina.base}/logs/idm-profile-%d{yyyy-MM-dd}.%i.log</filePattern>
            <maxHistory>10</maxHistory>
            <maxFileSize>100MB</maxFileSize>
            <append>true</append>
        </appender>
        <rootLoggerAppender>IDM_LOG</rootLoggerAppender>
        <rootLoggerLevel>INFO</rootLoggerLevel>
        <auditing>
            <enabled>false</enabled>
            <details>false</details>
        </auditing>
    </logging>
    <notificationConfiguration>
        <handler>
            <accountActivationNotifier>
                <recipientExpression>
                    <script>
                        <code>requestee.getEmailAddress()</code>
                    </script>
                </recipientExpression>
                <transport>mail</transport>
                <confirmationMethod>link</confirmationMethod>
            </accountActivationNotifier>
        </handler>
        <handler>
            <accountPasswordNotifier>
                <recipientExpression>
                    <value>accountPasswordNotifier@evolveum.com</value>
                </recipientExpression>
                <transport>mail</transport>
            </accountPasswordNotifier>
        </handler>
        <handler>
            <userPasswordNotifier>
                <recipientExpression>
                    <value>userPasswordNotifier@evolveum.com</value>
                </recipientExpression>
                <transport>mail</transport>
            </userPasswordNotifier>
        </handler>
        <handler>
            <status>success</status>
            <simpleResourceObjectNotifier>
                <recipientExpression>
                    <value>simpleResourceObjectNotifier@evolveum.com</value>
                </recipientExpression>
                <transport>mail</transport>
            </simpleResourceObjectNotifier>
        </handler>
        <mail>
            <redirectToFile>/var/opt/midpoint-hash/mail.log</redirectToFile>
        </mail>
    </notificationConfiguration>
    <cleanupPolicy>
        <auditRecords>
            <maxAge>P3M</maxAge>
        </auditRecords>
        <closedTasks>
            <maxAge>P1M</maxAge>
        </closedTasks>
    </cleanupPolicy>
    <adminGuiConfiguration>
        <userDashboardLink>
            <targetUrl>/self/profile</targetUrl>
            <label>Profile</label>
            <description>View/edit your profile</description>
            <icon>
                <cssClass>fa fa-user</cssClass>
            </icon>
            <color>green</color>
            <authorization>http://midpoint.evolveum.com/xml/ns/public/security/authorization-ui-3#selfProfile</authorization>
            <authorization>http://midpoint.evolveum.com/xml/ns/public/security/authorization-ui-3#selfAll</authorization>
        </userDashboardLink>
        <userDashboardLink>
            <targetUrl>/self/credentials</targetUrl>
            <label>Credentials</label>
            <description>View/edit your credentials</description>
            <icon>
                <cssClass>fa fa-shield</cssClass>
            </icon>
            <color>blue</color>
            <authorization>http://midpoint.evolveum.com/xml/ns/public/security/authorization-ui-3#selfCredentials</authorization>
            <authorization>http://midpoint.evolveum.com/xml/ns/public/security/authorization-ui-3#selfAll</authorization>
        </userDashboardLink>
        <userDashboardLink>
            <targetUrl>/admin/users</targetUrl>
            <label>List users</label>
            <icon>
                <cssClass>fa fa-users</cssClass>
            </icon>
            <color>red</color>
            <authorization>http://midpoint.evolveum.com/xml/ns/public/security/authorization-ui-3#users</authorization>
        </userDashboardLink>
        <userDashboardLink>
            <targetUrl>/admin/resources</targetUrl>
            <label>List resources</label>
            <icon>
                <cssClass>fa fa-database</cssClass>
            </icon>
            <color>purple</color>
            <authorization>http://midpoint.evolveum.com/xml/ns/public/security/authorization-ui-3#resources</authorization>
        </userDashboardLink>
    </adminGuiConfiguration>
</systemConfiguration>
