co.elastic.logging.logback.boot.ecs-file-appender.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?> <!-- ECS JSON file appender logback configuration provided for import, similar to the file-appender.xml included in Spring Boot <include resource="co/elastic/logging/logback/boot/ecs-file-appender.xml" /> --> <included> <springProperty name="SERVICE_NAME" source="spring.application.name"/> <appender name="ECS_JSON_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <encoder class="co.elastic.logging.logback.EcsEncoder"> <serviceName>${SERVICE_NAME:-spring-boot-application}</serviceName> </encoder> <file>${LOG_FILE}.json</file> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <cleanHistoryOnStart>${LOG_FILE_CLEAN_HISTORY_ON_START:-false}</cleanHistoryOnStart> <fileNamePattern>${ROLLING_FILE_NAME_PATTERN:-${LOG_FILE}.json.%d{yyyy-MM-dd}.%i.gz}</fileNamePattern> <maxFileSize>${LOG_FILE_MAX_SIZE:-10MB}</maxFileSize> <maxHistory>${LOG_FILE_MAX_HISTORY:-7}</maxHistory> <totalSizeCap>${LOG_FILE_TOTAL_SIZE_CAP:-0}</totalSizeCap> </rollingPolicy> </appender> </included>