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
- Host: GitHub
- URL: https://github.com/sivalabs/spring-utils
- Owner: sivalabs
- License: apache-2.0
- Created: 2018-09-29T11:39:40.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2023-05-18T16:08:51.000Z (about 3 years ago)
- Last Synced: 2025-03-27T14:55:46.015Z (about 1 year ago)
- Topics: spring, spring-boot
- Language: Java
- Size: 24.4 KB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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`