akkinoc / logback-access-spring-boot-starter

Spring Boot Starter for Logback-access.
Apache License 2.0
193 stars 32 forks source link

Have different starters for jetty and tomcat #453

Open justin-tay opened 3 months ago

justin-tay commented 3 months ago

Describe the problem you'd like to have solved

The current logback-access-spring-boot-starter has both ch.qos.logback.access:jetty12 and ch.qos.logback.access:tomcat as compile dependencies which then also pulls the respective jetty12 and tomcat server implementations. This makes it necessary to exclude the dependency that isn't used when using the starter.

<dependency>
    <groupId>dev.akkinoc.spring.boot</groupId>
    <artifactId>logback-access-spring-boot-starter</artifactId>
    <version>${logback-access-spring-boot-starter.version}</version>
    <exclusions>
        <exclusion>
            <groupId>ch.qos.logback.access</groupId>
            <artifactId>tomcat</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Describe the solution you'd like

It might be a better developer experience to have 2 separate starters similar to spring-boot-starter-jetty and spring-boot-starter-tomcat eg.

DarkAtra commented 2 months ago

We also ran into this issue when updating to version 4.2.2. We currently have to resort to excluding tomcat whenever we want to use jetty or undertow via:

<dependency>
  <groupId>dev.akkinoc.spring.boot</groupId>
  <artifactId>logback-access-spring-boot-starter</artifactId>
  <exclusions>
    <exclusion>
      <groupId>ch.qos.logback.access</groupId>
      <artifactId>tomcat</artifactId>
    </exclusion>
  </exclusions>
</dependency>

What do you think @akkinoc?