apiVersion: v1
kind: ConfigMap
metadata:
  name: log4j2
data:
  log4j2.yml: |-
    Configuration:
      Appenders:
        Console:
          PatternLayout:
            pattern: '[%-5level] %msg%n'
          name: Console
          target: SYSTEM_OUT
        # Do not remove this appender as is needed by the /system/logs endpoint
        # If you want to save the logs elsewhere just add another appender.
        RollingFile:
          - name: LogToRollingFile
            fileName: "${sys:ROUTR_DATA}/logs/routr.log"
            filePattern: "${sys:ROUTR_DATA}/logs/$${date:yyyy-MM}/routr-%d{MM-dd-yyyy}-%i.log.gz"
            PatternLayout:
              pattern: "[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n"
            Policies:
              SizeBasedTriggeringPolicy:
                size: 10MB
            DefaultRollOverStrategy:
              max: 10
      Loggers:
        Root:
          level: debug
          AppenderRef:
          - ref: Console
          - ref: LogToRollingFile
