2017-01-11 44 views
5

Tamamen çocuklar bir logback-spring.xml yapılandırmaya çalışıyorum.Logback yapılandırması canlı önyükleme (tarama = doğru) Spring-Boot ile

Amacım, değişiklik yapıldıktan sonra yapılandırma dosyasını otomatik olarak yeniden yüklemektir.

DAN:

Yani bu doc diyor ki

<configuration> 
    ... 
</configuration> 

İÇİN:

: Ben gibi herhangi unsurları kullanmak yoksa hiç şüphe yoktur

<configuration scan="true" scanPeriod="30 seconds"> 
    ... 
</configuration> 

<springProperty> 

VEYA

<springProfile> 

Canlı yükleme sorunsuz çalışır. Ayrıca scan="true"springProfile kullanmıyor ve springProperty da mükemmel çalışıyor.

Sonuç olarak, spring öğelerinin ve scan öğelerinin birbirinden hoşlanmamasıdır. Ben türünden hatalar alıyorum:

16:29:39,101 |-ERROR in [email protected]:125 - no applicable action for [springProperty], current ElementPath is [[configuration][springProperty]] 
16:29:39,102 |-ERROR in ch.qos.logback.cor[email protected]:109 - no applicable action for [springProperty], current ElementPath is [[configuration][springProperty]] 
16:29:39,102 |-ERROR in [email protected]:64 - no applicable action for [springProperty], current ElementPath is [[configuration][springProperty]] 
16:29:39,103 |-ERROR in [email protected]:29 - no applicable action for [springProfile], current ElementPath is [[configuration][springProfile]] 
16:29:39,103 |-ERROR in [email protected]:70 - no applicable action for [appender], current ElementPath is [[configuration][springProfile][appender]] 
16:29:39,103 |-ERROR in [email protected]:13 - no applicable action for [encoder], current ElementPath is [[configuration][springProfile][appender][encoder]] 
16:29:39,103 |-ERROR in [email protected]:14 - no applicable action for [pattern], current ElementPath is [[configuration][springProfile][appender][encoder][pattern]] 
16:29:39,104 |-ERROR in [email protected]:12 - no applicable action for [append], current ElementPath is [[configuration][springProfile][appender][append]] 
16:29:39,104 |-ERROR in [email protected]:10 - no applicable action for [file], current ElementPath is [[configuration][springProfile][appender][file]] 
16:29:39,104 |-ERROR in [email protected]:70 - no applicable action for [appender], current ElementPath is [[configuration][springProfile][appender]] 
16:29:39,104 |-ERROR in [email protected]:13 - no applicable action for [encoder], current ElementPath is [[configuration][springProfile][appender][encoder]] 
16:29:39,104 |-ERROR in [email protected]:14 - no applicable action for [pattern], current ElementPath is [[configuration][springProfile][appender][encoder][pattern]] 
16:29:39,105 |-ERROR in [email protected]:12 - no applicable action for [append], current ElementPath is [[configuration][springProfile][appender][append]] 
16:29:39,105 |-ERROR in [email protected]:10 - no applicable action for [file], current ElementPath is [[configuration][springProfile][appender][file]] 
16:29:39,105 |-ERROR in [email protected]:70 - no applicable action for [appender], current ElementPath is [[configuration][springProfile][appender]] 
16:29:39,105 |-ERROR in [email protected]:13 - no applicable action for [encoder], current ElementPath is [[configuration][springProfile][appender][encoder]] 
16:29:39,106 |-ERROR in [email protected]:14 - no applicable action for [pattern], current ElementPath is [[configuration][springProfile][appender][encoder][pattern]] 
16:29:39,106 |-ERROR in [email protected]:12 - no applicable action for [append], current ElementPath is [[configuration][springProfile][appender][append]] 
16:29:39,106 |-ERROR in [email protected]:10 - no applicable action for [file], current ElementPath is [[configuration][springProfile][appender][file]] 
16:29:39,106 |-ERROR in [email protected]:70 - no applicable action for [appender], current ElementPath is [[configuration][springProfile][appender]] 
16:29:39,106 |-ERROR in [email protected]:13 - no applicable action for [encoder], current ElementPath is [[configuration][springProfile][appender][encoder]] 
16:29:39,107 |-ERROR in [email protected]:14 - no applicable action for [pattern], current ElementPath is [[configuration][springProfile][appender][encoder][pattern]] 
16:29:39,107 |-ERROR in [email protected]:12 - no applicable action for [append], current ElementPath is [[configuration][springProfile][appender][append]] 
16:29:39,107 |-ERROR in [email protected]:10 - no applicable action for [file], current ElementPath is [[configuration][springProfile][appender][file]] 
16:29:39,107 |-ERROR in [email protected]:70 - no applicable action for [appender], current ElementPath is [[configuration][springProfile][appender]] 
16:29:39,107 |-ERROR in [email protected]:13 - no applicable action for [encoder], current ElementPath is [[configuration][springProfile][appender][encoder]] 
16:29:39,107 |-ERROR in [email protected]:14 - no applicable action for [pattern], current ElementPath is [[configuration][springProfile][appender][encoder][pattern]] 
16:29:39,108 |-ERROR in [email protected]:12 - no applicable action for [append], current ElementPath is [[configuration][springProfile][appender][append]] 
16:29:39,108 |-ERROR in [email protected]:10 - no applicable action for [file], current ElementPath is [[configuration][springProfile][appender][file]] 
16:29:39,108 |-ERROR in [email protected]:53 - no applicable action for [logger], current ElementPath is [[configuration][springProfile][logger]] 
16:29:39,108 |-ERROR in [email protected]:35 - no applicable action for [appender-ref], current ElementPath is [[configuration][springProfile][logger][appender-ref]] 
16:29:39,108 |-ERROR in ch.qos.logback.core.jor[email protected]:54 - no applicable action for [logger], current ElementPath is [[configuration][springProfile][logger]] 
16:29:39,108 |-ERROR in [email protected]:35 - no applicable action for [appender-ref], current ElementPath is [[configuration][springProfile][logger][appender-ref]] 
16:29:39,108 |-ERROR in [email protected]:23 - no applicable action for [logger], current ElementPath is [[configuration][springProfile][logger]] 
16:29:39,108 |-ERROR in [email protected]:35 - no applicable action for [appender-ref], current ElementPath is [[configuration][springProfile][logger][appender-ref]] 
16:29:39,109 |-ERROR in [email protected]:37 - no applicable action for [logger], current ElementPath is [[configuration][springProfile][logger]] 
16:29:39,109 |-ERROR in [email protected]:35 - no applicable action for [appender-ref], current ElementPath is [[configuration][springProfile][logger][appender-ref]] 
16:29:39,109 |-ERROR in [email protected]:54 - no applicable action for [logger], current ElementPath is [[configuration][springProfile][logger]] 
16:29:39,109 |-ERROR in [email protected]:35 - no applicable action for [appender-ref], current ElementPath is [[configuration][springProfile][logger][appender-ref]] 
16:29:39,109 |-ERROR in [email protected]:54 - no applicable action for [logger], current ElementPath is [[configuration][springProfile][logger]] 
16:29:39,109 |-ERROR in [email protected]:35 - no applicable action for [appender-ref], current ElementPath is [[configuration][springProfile][logger][appender-ref]] 
16:29:39,109 |-ERROR in [email protected]:23 - no applicable action for [root], current ElementPath is [[configuration][springProfile][root]] 
16:29:39,109 |-ERROR in [email protected]:35 - no applicable action for [appender-ref], current ElementPath is [[configuration][springProfile][root][appender-ref]] 
16:29:39,109 |-ERROR in [email protected]:28 - no applicable action for [springProfile], current ElementPath is [[configuration][springProfile]] 
16:29:39,110 |-ERROR in [email protected]:72 - no applicable action for [appender], current ElementPath is [[configuration][springProfile][appender]] 
16:29:39,110 |-ERROR in [email protected]:13 - no applicable action for [encoder], current ElementPath is [[configuration][springProfile][appender][encoder]] 
16:29:39,110 |-ERROR in [email protected]:14 - no applicable action for [pattern], current ElementPath is [[configuration][springProfile][appender][encoder][pattern]] 
16:29:39,110 |-ERROR in [email protected]:14 - no applicable action for [charset], current ElementPath is [[configuration][springProfile][appender][encoder][charset]] 
16:29:39,110 |-ERROR in [email protected]:76 - no applicable action for [appender], current ElementPath is [[configuration][springProfile][appender]] 
16:29:39,110 |-ERROR in [email protected]:13 - no applicable action for [encoder], current ElementPath is [[configuration][springProfile][appender][encoder]] 
16:29:39,110 |-ERROR in [email protected]:14 - no applicable action for [pattern], current ElementPath is [[configuration][springProfile][appender][encoder][pattern]] 
16:29:39,110 |-ERROR in [email protected]:14 - no applicable action for [charset], current ElementPath is [[configuration][springProfile][appender][encoder][charset]] 
16:29:39,110 |-ERROR in [email protected]:54 - no applicable action for [logger], current ElementPath is [[configuration][springProfile][logger]] 
16:29:39,110 |-ERROR in [email protected]:38 - no applicable action for [appender-ref], current ElementPath is [[configuration][springProfile][logger][appender-ref]] 
16:29:39,111 |-ERROR in [email protected]:23 - no applicable action for [root], current ElementPath is [[configuration][springProfile][root]] 
16:29:39,111 |-ERROR in [email protected]:34 - no applicable action for [appender-ref], current ElementPath is [[configuration][springProfile][root][appender-ref]] 

Yani zaten ben scan=true kaldırırsanız yapılandırma çalışır söylediği gibi. SpringProfiles ve özellikleri kaldırır ve scan=true'u bırakırsam, yapılandırma yeniden çalışır, ancak BOTH ile bazı şeyler doğru olmaz mı?

Bunu yapmak imkansız olduğunu, ancak birisinin bunu yapmanın bir yolunu bulduğunu varsayıyorum.

DÜZENLEME: sorum Bahar onların documentation güncellenen yayınlanmıştır sonra bir haftaya yakın. Yine de yanıt arıyorum ve logback belgelerinin konfigürasyona özellik dosyalarını içe aktarabileceğini söylediği için Spring özellikleri ve logback yapılandırma dosyası arasında bazı orta kat özellik dosyalarının kullanılmasının bir yolu olabileceğini düşünüyorum. Ama yine de olsa bile springProfile ile sorun kalır.

cevap