Skip to content

md2java/md2java-util-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##m2java-util-starter

This is util starter with logging request and response along with time taken by method also
base on the annotation on method.

How to use it
-------------------
pre-requisite:
---------------------
1) consumer must be spring boot application
2) consumer must use minimum jdk8
 
 3 step to  get benefit of it.
---------------------------------
1) add dependency latest one
2) use @EnableM2JavaUtil
3) use @LogMethodInfo on business method 


example:
-------------
@SpringBootApplication
@Slf4j
@EnableM2JavaUtil
@RestController
public class DemoApplication {

public static void main(String[] args) {
	SpringApplication.run(DemoApplication.class, args);
}

@GetMapping("/hello")
@LogMethodInfo()
	public String hello() {
	log.info("hello Rest....");
	return "Hello";
}

}

output
--------
c.g.md2java.service.LogMethodInfoAspect  : ==> Method:DemoApplication.hello() request:[]
com.example.demo.DemoApplication         : hello Rest....
c.g.md2java.service.LogMethodInfoAspect  : ==< Method:DemoApplication.hello() response:Hello
c.g.md2java.service.LogMethodInfoAspect  : ##method=DemoApplication.hello()##execution-time=21ms

About

for logging request and respose for any bean method using annotation

Resources

Stars

Watchers

Forks

Languages