Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DynamicCE/spring-detailed-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Spring Detailed Logger

Maven Central License: MIT Java Version

A simple and powerful library that provides detailed method logging capabilities for Spring Boot applications.

πŸš€ Features

  • Detailed method call logging
  • Automatic performance metrics tracking
  • HTTP request details (IP, headers)
  • Memory usage information
  • Correlation ID support
  • Spring profile information
  • Exception handling and logging
  • Emoji-enhanced readable log format

πŸ“¦ Installation

Add the Maven dependency:

<dependency>
    <groupId>io.github.dynamicce</groupId>
    <artifactId>spring-detailed-logger</artifactId>
    <version>1.0.4</version>
</dependency>


## πŸ”§ Usage

1. Add the @LogDetails annotation to the methods you want to log:

@RestController
public class UserController {

    @LogDetails
    @GetMapping("/users/{id}")
    public User getUser(@PathVariable Long id) {
        return userService.findById(id);
    }

}

2. The log output will look like this:

🎯 Method: getUser
πŸ“ Parameters: id=1
⏱️ Execution Time: 145ms
🌐 IP: 192.168.1.1
πŸ”‘ Correlation ID: abc123
πŸ’Ύ Memory Usage: 24MB
πŸ”§ Profile: development

## βš™οΈ Configuration

You can customize the following settings in your application.properties or application.yml:

spring:
detailed-logger:
enabled: true
include-memory-info: true
include-profile-info: true
correlation-id-header: X-Correlation-ID

## 🀝 Contributing

1. Fork this repository
2. Create your feature branch (git checkout -b feature/amazing-feature)
3. Commit your changes (git commit -m 'feat: Add amazing feature')
4. Push to the branch (git push origin feature/amazing-feature)
5. Open a Pull Request

## πŸ“ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## πŸ™ Acknowledgments

Thank you for using this library! If you have any issues or suggestions, please feel free to reach out through GitHub Issues.

About

πŸ“ A Spring Boot library for detailed method logging with performance metrics and request tracking πŸš€ Features: Method logging, Performance tracking, HTTP details, Memory usage, Correlation ID

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages