Consul refresh event with @RefreshScope stops application logback logging?

When a property is changed on Consul, all logging inside of the application stops. I utilize @RefreshScope on a few @Configuration classes, nowhere else and on nothing related to logging. The application is started inside of a docker container and a few of the logging properties such as logging location and file name are picked up at runtime via environment variables – this works fine. We use logback for logging and it is configured via xml. I’m suspecting that the logback configuration reloads on a consul refresh event and isn’t able to continue logging afterwards.

I’ve tried removing all relevant logging properties from consul which didn’t solve the issue. I’ve made sure that all @RefreshScope annotations do not have anything to do with logback and this is true. I’m attaching the logback configuration below as I believe that to be the most relevant at the moment. Attempted at printing debug logs for logback but even after adding -Dlogback.debug=true or <configuration debug="true"> in the xml, there was no debug log output.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

    <springProperty scope="context" name="LOGGING_JSON_PATH" source="logging.json.path"/>
    <springProperty scope="context" name="LOGGING_TEXT_PATH" source="logging.text.path"/>
    <springProperty scope="context" name="LOG_FILE_NAME" source="logging.file.name"/>
    <springProperty scope="context" name="LOGGING_JOB_PATH" source="logging.job.path"/>
    <springProperty scope="context" name="LOGGING_JOB_FILE_NAME" source="logging.job.file.name"/>

    <if condition='isDefined("LOGGING_JSON_PATH")'>
        <then>
            <!-- Appender for SPLUNK -->
            <appender name="JSON_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
                <append>true</append>
                <File>${LOGGING_JSON_PATH}/${LOG_FILE_NAME}</File>
                <!--https://github.com/logstash/logstash-logback-encoder#standard-fields -->
                <encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
                    <providers>
                        <mdc/>
                        <timestamp />
                        <version />
                        <threadName />
                        <pattern>
                            <pattern>
                                {
                                "message": "%message",
                                "severity":"%p",
                                "component": "%c{1}",
                                "line_number": "[%file:%line]",
                                "userid": "%X{userId}",
                                "sessionId": "%X{sessionId}",
                                "app": "project",
                                "stackTrace": "%X{stack_trace}"
                                }
                            </pattern>
                        </pattern>
                        <stackTrace>
                            <throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
                                <maxDepthPerThrowable>30</maxDepthPerThrowable>
                                <maxLength>2048</maxLength>
                                <shortenedClassNameLength>20</shortenedClassNameLength>
                                <exclude>^sun.reflect..*.invoke</exclude>
                                <exclude>^net.sf.cglib.proxy.MethodProxy.invoke</exclude>
                                <rootCauseFirst>true</rootCauseFirst>
                            </throwableConverter>
                        </stackTrace>
                    </providers>
                </encoder>

                <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                    <!-- By setting the name to .gz here, we get free compression. -->
                    <fileNamePattern>${LOGGING_JSON_PATH}/${LOG_FILE_NAME}.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
                    <timeBasedFileNamingAndTriggeringPolicy
                            class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                        <maxFileSize>20MB</maxFileSize>
                    </timeBasedFileNamingAndTriggeringPolicy>
                    <!-- https://logback.qos.ch/manual/appenders.html#tbrpMaxHistory -->
                    <maxHistory>1</maxHistory>
                    <cleanHistoryOnStart>true</cleanHistoryOnStart>
                </rollingPolicy>
            </appender>
        </then>
    </if>

    ...
</configuration>

I have omitted most of the configuration for brewity. But the loggers and appenders work as expected and log to the expected files. When a consul environment change event is fired, all logging stops.

The logback environment variables are passed through docker-compose:

environment:
  - "SPRING_PROFILES_ACTIVE={{ key "/placeholder/project/SPRING_PROFILES_ACTIVE" }}"
  - "LOGGING_FILE_NAME={{ key "/placeholder/project/LOGGING_FILE_NAME" }}"
  - "LOGGING_JOB_PATH_FILE_NAME={{ key "/placeholder/project/LOGGING_JOB_PATH_FILE_NAME" }}"

The value and property names were changed to remove sensitive information so typos and mismatched names are possible.

Has anyone experienced something similar?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật