Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import external properties for logback(.xml)

Tags:

xml

logback

I've got a logback.xml config file as follows:

<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="30 seconds">
  <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern>%d{HH:mm:ss,GMT} %-5p [%t] %c{10} %X{hub}/%X{device}/%X{channel} %m%n</pattern>
    </encoder>
  </appender>

  <logger name="org.hibernate" level="WARN"/>

  <root level="WARN">
    <appender-ref ref="console"/>
  </root>
</configuration>

And i am wondering if i am able to load an external appender and logger from another .xml file into this file for use? Any ideas?

I don't want this external appender and logger directly in the main .xml.

Thanks D

like image 979
user993159 Avatar asked May 25 '26 12:05

user993159


1 Answers

Previous link provided by @Spencer Kormos was not working hence updating the link http://logback.qos.ch/manual/configuration.html#fileInclusion so that for future user its readily accessible.

like image 95
Karthik Prasad Avatar answered May 28 '26 16:05

Karthik Prasad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!