Public | Automated Build

Last pushed: 9 months ago
Short Description
An sbt logback project that builds with an external logback.xml
Full Description


  • To run this project, install Docker
  • Run: docker pull animatedlew/logger
  • Verify logs: docker run -it --rm animatedlew/logger cat /var/log/cota/helix/debug.log


This project uses sbt assembly to build a fat jar that moves logback.xml into a central location. It then runs the fat jar with the new location of the logback file. e.g.

java -Dlogback.configurationFile=/opt/logback.xml -jar target/scala-2.12/log.jar

The classpath of files inside of src/main/resources does not automatically resolve.

Build & Run Locally

  • build: docker build -t animatedlew/logger .
  • run: docker run -it --rm animatedlew/logger cat /var/log/cota/helix/debug.log

Example logback.xml

<?xml version="1.0" encoding="UTF-8"?>

    <property name="DEV_HOME" value="/var/log/cota/helix" />

    <appender name="FILE-AUDIT"
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
                %d{yyyy-MM-dd HH:mm:ss} [%-5level] - %msg%n

        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">


    <logger name="com.animatedlew" level="debug" additivity="false">
        <appender-ref ref="FILE-AUDIT" />

    <root level="error">
        <appender-ref ref="FILE-AUDIT" />

Docker Pull Command
Source Repository