apiVersion: v1
kind: ConfigMap
metadata:
  name: ma-log-config
  namespace: appdynamics
data:
  log4j.xml: |
    <?xml version="1.0" encoding="UTF-8" ?>
    <configuration status="Warn" monitorInterval="30">

        <Appenders>
            <Console name="ConsoleAppender" target="SYSTEM_OUT">
                <PatternLayout pattern="%d{ABSOLUTE} %5p [%t] %c{1} - %m%n"/>
            </Console>

            <RollingFile name="FileAppender" fileName="${log4j:configParentLocation}/../../logs/machine-agent.log"
                         filePattern="${log4j:configParentLocation}/../../logs/machine-agent.log.%i">
                <PatternLayout>
                    <Pattern>[%t] %d{DATE} %5p %c{1} - %m%n</Pattern>
                </PatternLayout>
                <Policies>
                    <SizeBasedTriggeringPolicy size="5000 KB"/>
                </Policies>
                <DefaultRolloverStrategy max="5"/>
            </RollingFile>
        </Appenders>

        <Loggers>
            <Logger name="com.singularity" level="info" additivity="false">
                <AppenderRef ref="FileAppender"/>
                <AppenderRef ref="ConsoleAppender"/>
            </Logger>
            <Logger name="com.appdynamics" level="info" additivity="false">
                <AppenderRef ref="FileAppender"/>
                <AppenderRef ref="ConsoleAppender"/>
            </Logger>
            <Logger name="com.singularity.ee.agent.systemagent.task.sigar.SigarAppAgentMonitor" level="info" additivity="false">
                <AppenderRef ref="FileAppender"/>
                <AppenderRef ref="ConsoleAppender"/>
            </Logger>
            <Root level="error">
                <AppenderRef ref="FileAppender"/>
                <AppenderRef ref="ConsoleAppender"/>
            </Root>
        </Loggers>

    </configuration>

