No description
Find a file
Renovate Bot 62c12296f7
All checks were successful
/ release (push) Successful in 1m32s
fix(deps): update all dependencies (#7)
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [io.mockk:mockk-jvm](https://mockk.io) ([source](https://github.com/mockk/mockk)) | `1.14.7` → `1.14.9` | ![age](https://developer.mend.io/api/mc/badges/age/maven/io.mockk:mockk-jvm/1.14.9?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.mockk:mockk-jvm/1.14.7/1.14.9?slim=true) |
| [org.junit.jupiter:junit-jupiter](https://junit.org/) ([source](https://github.com/junit-team/junit-framework)) | `6.0.1` → `6.0.3` | ![age](https://developer.mend.io/api/mc/badges/age/maven/org.junit.jupiter:junit-jupiter/6.0.3?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.junit.jupiter:junit-jupiter/6.0.1/6.0.3?slim=true) |
| [de.loosetie.utils:lt-utils-bom](https://loosetie.de) | `1.1.8` → `2.0.1` | ![age](https://developer.mend.io/api/mc/badges/age/maven/de.loosetie.utils:lt-utils-bom/2.0.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/de.loosetie.utils:lt-utils-bom/1.1.8/2.0.1?slim=true) |
| [org.springframework.boot:spring-boot-dependencies](https://spring.io/projects/spring-boot) ([source](https://github.com/spring-projects/spring-boot)) | `4.0.1` → `4.0.3` | ![age](https://developer.mend.io/api/mc/badges/age/maven/org.springframework.boot:spring-boot-dependencies/4.0.3?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.springframework.boot:spring-boot-dependencies/4.0.1/4.0.3?slim=true) |
| [de.loosetie.logging:lt-logging-parent](https://loosetie.de) | `1.0.8` → `1.0.9` | ![age](https://developer.mend.io/api/mc/badges/age/maven/de.loosetie.logging:lt-logging-parent/1.0.9?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/de.loosetie.logging:lt-logging-parent/1.0.8/1.0.9?slim=true) |

Co-authored-by: Renovate Bot <renovate@denktmit.tech>
Co-committed-by: Renovate Bot <renovate@denktmit.tech>
2026-03-12 08:08:58 +00:00
.forgejo/workflows fix(deps): update all dependencies (#6) 2025-12-29 09:05:30 +00:00
_bom fix(deps): update all dependencies (#7) 2026-03-12 08:08:58 +00:00
_parent fix(deps): update all dependencies (#7) 2026-03-12 08:08:58 +00:00
api fix(deps): update all dependencies (#7) 2026-03-12 08:08:58 +00:00
core fix(deps): update all dependencies (#7) 2026-03-12 08:08:58 +00:00
okhttp fix(deps): update all dependencies (#7) 2026-03-12 08:08:58 +00:00
rest-template fix(deps): update all dependencies (#7) 2026-03-12 08:08:58 +00:00
servlet fix(deps): update all dependencies (#7) 2026-03-12 08:08:58 +00:00
spring-aop fix(deps): update all dependencies (#7) 2026-03-12 08:08:58 +00:00
spring-boot-starter fix(deps): update all dependencies (#7) 2026-03-12 08:08:58 +00:00
.editorconfig refactor: repository split 2024-06-07 15:00:43 +02:00
.gitignore refactor: repository split 2024-06-07 15:00:43 +02:00
LICENSE.txt chore: updated dependencies 2024-10-24 11:34:59 +02:00
pom.xml fix(deps): update all dependencies (#7) 2026-03-12 08:08:58 +00:00
README.md chore: Update README 2024-06-07 17:09:56 +02:00
renovate.json fix(deps): update all dependencies (#1) 2025-02-22 20:28:43 +00:00

LT :: Logging

for Kotlin apps. built on slf4j/logback, with various integrations for easy I/O integration

Integrations

  • servlet: Default Java Servlet API. Register LoggingFilter to get inbound http logging
  • Spring AOP: An aspect to provide annotation based logging
  • SpringBoot starter: Autoconfiguration for Spring Boot
  • OkHttp: An Interceptor to log outgoing http
  • Spring RestTemplate: An ClientHttpRequestInterceptor to log outgoing http

Usage

  1. Add the BOM
    <dependencyManagement>
        <dependency>
            <groupId>de.loosetie.logging</groupId>
            <artifactId>lt-logging-bom</artifactId>
            <version>{version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencyManagement>
    
  2. Choose modules to use
    <dependencies>
        <dependency>
            <groupId>de.loosetie.logging</groupId>
            <artifactId>lt-logging-servlet</artifactId>
        </dependency>
        <dependency>
            <groupId>de.loosetie.logging</groupId>
            <artifactId>lt-logging-spring-aop</artifactId>
        </dependency>
    </dependencies>
    
  3. For Spring Boot the lt-logging-spring-starter will provide a basic configuration. Property support is provided with the prefix lt.logging using the spring way

Log

The interface Log is a layer over slf4j/logback to provide asynchronous message building.

import de.loosetie.logging.logFactory

class Example {
    val log by logFactory()
}

This will configure the logger for class Example, additionally LogFactory.getLogger is available if more customization is needed.

RequestId

The RequestId is structured hierarchically, so you can follow the context build by your logging needs. Pattern: <AppId>[-<Prefix><Sequence>...]

  • AppId: A random Integer generated at startup
  • Prefix: A customizable prefix to quickly identify your context (keep it short :))
  • Sequence: A number counted for every generated RequestId in the same scope Prefix and Sequence may be repeated, if a RequestId is generated at a sub-scope

Examples:

8ee36c0c-h1           # HttpFilter get a request
8ee36c0c-h1-s0        # A service is called
8ee36c0c-h1-s0-db1    # DB access
8ee36c0c-h1-s0-db2
8ee36c0c-h1-s0        # Return of the service processing

8ee36c0c-h1-s1        # Second service
8ee36c0c-h1-s1-r0     # REST call
8ee36c0c-h1

LogIt

An annotation provided by lt-logging-spring-aop allows you to add logs to all spring beans annotated with @LogIt. This can be done on function or class level for public members.

Hint: As for all aspect oriented features this only works on open/non-final functions.

Coroutines

As kotlin coroutines are a separate concept to threads, watch out for the right context.

For this purpose you can use LoggingContext:

import de.loosetie.logging.coroutines.LoggingContext
//...
fun example() {
    runBlocking {
        launch(Dispatchers.Default + LoggingContext()) {
            // Slf4j MDC and RequestId context is fine here
        }
    }
}

See also: kotlinx-coroutines-slf4j