Skip to content

logback.xml not being detected in v4 #3797

@froque

Description

@froque
pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <artifactId>jooby-logback-demo</artifactId>
  <groupId>app</groupId>
  <version>1.0.0</version>

  <name>jooby-logback-demo</name>

  <properties>
    <application.class>app.App</application.class>

    <!--
        v4.0.9 does not detect conf/application.conf
        v3.11.4 detects conf/application.conf
    -->
    <jooby.version>4.0.9</jooby.version>
    <!-- <jooby.version>3.11.4</jooby.version>-->

    <maven.compiler.source>21</maven.compiler.source>
    <maven.compiler.target>21</maven.compiler.target>
    <maven.compiler.parameters>true</maven.compiler.parameters>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>io.jooby</groupId>
      <artifactId>jooby-netty</artifactId>
    </dependency>
    <dependency>
      <groupId>io.jooby</groupId>
      <artifactId>jooby-logback</artifactId>
    </dependency>
  </dependencies>


  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.jooby</groupId>
        <artifactId>jooby-bom</artifactId>
        <version>${jooby.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
</project>

conf/logback.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="15 seconds" debug="false">
  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern> is this in use ?? [%d{ISO8601}]-[%thread] %-5level %logger - %msg%n</pattern>
    </encoder>
  </appender>

  <root level="INFO">
    <appender-ref ref="STDOUT" />
  </root>
</configuration>

src/main/java/app/App.java

package app;

import io.jooby.Jooby;

public class App extends Jooby {

  {
    get("/", ctx -> "Welcome to Jooby!");
  }

  public static void main(final String[] args) {
    runApp(args, App::new);
  }
}

With v4:

17:03:45.425 [main] DEBUG io.netty.util.internal.logging.InternalLoggerFactory -- Using SLF4J as the default logging framework
17:03:45.428 [main] DEBUG io.netty.util.ResourceLeakDetector -- -Dio.netty.leakDetection.level: disabled
17:03:45.428 [main] DEBUG io.netty.util.ResourceLeakDetector -- -Dio.netty.leakDetection.targetRecords: 4
(...)
17:03:45.645 [main] INFO app.App -- App (dev) started
17:03:45.645 [main] INFO app.App -- routes: 

  GET /

listening on:
  http://localhost:8080/

With v3:

is this in use ?? [2025-10-24 17:13:37,870]-[main] INFO  app.App - App (dev) started
is this in use ?? [2025-10-24 17:13:37,872]-[main] INFO  app.App - routes: 

  GET /

listening on:
  http://localhost:8080/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions