Logback scan not working

后端 未结 5 1263
清歌不尽
清歌不尽 2021-02-20 03:18

I am having trouble getting the auto scan functionality of logback to work. It doesn\'t seem to pick up the changes. I have added debug=\"true\" to section and reading it\'s ou

5条回答
  •  执念已碎
    2021-02-20 04:15

    You logback.xml appear to be correct.

    This is a behavior stated in the manual: http://logback.qos.ch/manual/configuration.html#autoScan,

    Given that ReconfigureOnChangeFilter is invoked every time any logger is invoked, regardless of logger level, ReconfigureOnChangeFilter is absolutely performance critical. So much so that in fact, the check whether the scan period has elapsed or not, is too costly in itself. In order to improve performance, ReconfigureOnChangeFilter is in reality "alive" only once every N logging operations. Depending on how often your application logs, the value of N can be modified on the fly by logback. By default N is 16, although it can go as high as 2^16 (= 65536) for CPU-intensive applications.

    In short, when a configuration file changes, it will be automatically reloaded but only after several logger invocations and after a delay determined by the scanning period.

    Just try to log some more messages and see if the configuration is correctly loaded.

    I hope this help you out.

    Best regards,

    Miguel

提交回复
热议问题