An open API service indexing awesome lists of open source software.

https://github.com/sivalabs/spring-utils

Utilities commonly used in Spring applications
https://github.com/sivalabs/spring-utils

spring spring-boot

Last synced: about 1 month ago
JSON representation

Utilities commonly used in Spring applications

Awesome Lists containing this project

README

          

# spring-utils

This is a tiny utilities library with commonly used features in Spring applications.

## How to use?

### Add the dependency

**Maven**

```xml

io.github.sivalabs
spring-utils
0.0.3


Central Portal Snapshots
central-portal-snapshots
https://central.sonatype.com/repository/maven-snapshots/

false


true

io.github.sivalabs
spring-utils
0.0.4-SNAPSHOT

```

**Gradle**

```groovy
implementation 'io.github.sivalabs:spring-utils:0.0.3'

// To use SNAPSHOT version

repositories {
mavenCentral()
//Groovy DSL
maven { url = "https://central.sonatype.com/repository/maven-snapshots" }
//Kotlin DSL
maven { url = uri("https://central.sonatype.com/repository/maven-snapshots/") }
}

implementation 'io.github.sivalabs:spring-utils:0.0.4-SNAPSHOT'

```

### LoggingAspect

Add `io.github.sivalabs.springutils` package to ComponentScan

```java
@Configuration
@ComponentScan(basePackages={"io.github.sivalabs.springutils"})
public class AppConfig {

}
```

Use `@Loggable` annotation to Class or Method that you want to log.

```java
@Controller
@Loggable
public class MyController {

}

@Service
public class MyService {
@Loggable
public void doIt() {

}
}
```

Enable `DEBUG` log level to `io.github.sivalabs.springutils` in `application.properties`.

`logging.level.io.github.sivalabs.springutils=debug`