Skip to content

logback-access-spring-boot-starterSpring Boot向けHTTPアクセスロギング

TomcatとJetty対応のLogback Access自動設定

logback-access-spring-boot-starter

アーキテクチャ

クイックスタート

プロジェクトに依存関係を追加:

VERSIONMaven Centralの最新バージョンに置き換えてください。

kotlin
implementation("io.github.seijikohara:logback-access-spring-boot-starter:VERSION")
groovy
implementation 'io.github.seijikohara:logback-access-spring-boot-starter:VERSION'
xml
<dependency>
    <groupId>io.github.seijikohara</groupId>
    <artifactId>logback-access-spring-boot-starter</artifactId>
    <version>VERSION</version>
</dependency>

src/main/resources/logback-access.xmlを作成:

xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%h %l %u [%t] "%r" %s %b</pattern>
        </encoder>
    </appender>
    <appender-ref ref="console"/>
</configuration>

アプリケーションを起動すると、コンソールにアクセスログが出力されます。

要件

コンポーネントバージョン
Java21以上
Spring Boot4.0以上

ライセンス

このプロジェクトはApache License 2.0の下でライセンスされています。

Released under the Apache 2.0 License.