|
1 | | -# spt-development-logging-spring |
2 | | -Library for adding logging to public @RestController, @Service and @Repository class methods and @JmsListener methods. |
| 1 | +```` |
| 2 | + ____ ____ _____ ____ _ _ |
| 3 | + / ___|| _ \_ _| | _ \ _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ |
| 4 | + \___ \| |_) || | | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| |
| 5 | + ___) | __/ | | | |_| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ |
| 6 | + |____/|_| |_| |____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |
| 7 | + |_| |
| 8 | + logging-spring ----------------------------------------------------------------- |
| 9 | +```` |
| 10 | + |
| 11 | +[](https://travis-ci.com/spt-development/spt-development-logging-spring) |
| 12 | + |
| 13 | +A library for adding logging (at the start, end and on exception) to public methods of classes annotated with |
| 14 | +`@RestController`, `@Service` or `@Repository` or methods annotated with `@JmsListener`. |
| 15 | + |
| 16 | +Usage |
| 17 | +===== |
| 18 | + |
| 19 | +Register the Aspects as Spring Beans manually or by adding the |
| 20 | +[spt-development/spt-development-logging-spring-boot](https://github.com/spt-development/spt-development-logging-spring-boot) |
| 21 | +starter to your project's pom. |
| 22 | + |
| 23 | + @Bean |
| 24 | + public RestControllerLogger restControllerLogger() { |
| 25 | + return new RestControllerLogger(); |
| 26 | + } |
| 27 | + |
| 28 | + @Bean |
| 29 | + public JmsListenerLogger jmsListenerLogger() { |
| 30 | + return new JmsListenerLogger(); |
| 31 | + } |
| 32 | + |
| 33 | + @Bean |
| 34 | + public ServiceLogger serviceLogger() { |
| 35 | + return new ServiceLogger(); |
| 36 | + } |
| 37 | + |
| 38 | + @Bean |
| 39 | + public RepositoryLogger repositoryLogger() { |
| 40 | + return new RepositoryLogger(); |
| 41 | + } |
| 42 | + |
| 43 | +Building locally |
| 44 | +================ |
| 45 | + |
| 46 | +To build the library, run the following maven command: |
| 47 | + |
| 48 | + $ mvn clean install |
| 49 | + |
| 50 | +Release |
| 51 | +======= |
| 52 | + |
| 53 | +To build a release and upload to Maven Central run the following maven command: |
| 54 | + |
| 55 | + $ export GPG_TTY=$(tty) # Required on Mac OS X |
| 56 | + $ mvn deploy -DskipTests -Prelease |
| 57 | + |
| 58 | +NOTE. This is currently a manual step as not currently integrated into the build. |
0 commit comments