Thursday, 12 September 2019

springboot, user spring properties in logback.xml

in your logback.xml you can :

<springProperty scope="context" name="root-log-Level"
source="logging.level.root" />
<springProperty scope="context" name="app-log-Level"

source="logging.level.application" />

above will bring spring properties into your logback.xml and then you can use them like :

<root level="${root-log-Level}">
<appender-ref ref="consoleAppender" />


however, you cannot use it in the logback.xml.  you file must be in another name.e.g. logback-sex.xml

you need to add below in your file:



No comments:

Post a comment