Хорошо, ребята, я пытаюсь настроить a logback-spring.xml
.Резервная конфигурация резервного копирования (scan = true) с Spring-Boot
Моя цель - автоматически перезагрузить конфигурационный файл после изменения.
Так это то, что doc говорит:
ОТ:
<configuration>
...
</configuration>
TO:
<configuration scan="true" scanPeriod="30 seconds">
...
</configuration>
Существует никаких сомнений в том, что если я не использую какие-либо элементы, как:
<springProperty>
OR
<springProfile>
Живая перезагрузка работает без проблем. Также, если я не использую scan="true"
springProfile
и springProperty
также работают отлично.
Так что я пришел к выводу, что spring
элементов и scan
не любят друг друга. Я получаю сообщение об ошибке от типа:
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 [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 [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]]
Так как я уже сказал, что если я удалю scan=true
конфигурация работает. Если я удалю springProfiles и свойства и оставьте scan=true
, конфигурация работает снова, но с BOTH что-то не так?
Я предполагаю, что это, скорее всего, невозможно сделать, но кто-то нашел способ сделать это?
EDIT: Через неделю после того, как я отправил свой вопрос, весна обновила их documentation. Тем не менее, я ищу ответ, и я полагаю, что может быть способ, возможно, использовать некоторый средний слой файла свойств между параметрами Spring и конфигурационным файлом журнала, поскольку, поскольку в документации по протоколу указано, что вы можете импортировать файлы свойств в конфигурацию. Но все же даже если так, проблема с springProfile
остается.
Да наконец Гурий Spring-Boot обновил статью и добавляемые сканирование. Спасибо, но это еще не исправляет мою проблему. –