From f1c0bbda7c25758002c952a621f9f35bf84a00c6 Mon Sep 17 00:00:00 2001 From: Maxime Wiewiora Date: Sat, 24 Oct 2020 14:50:05 +0200 Subject: [PATCH] Prepare release 1.2.0 - Update dependencies - Improve documentation for usage of `autolog-aspectj` module --- CHANGELOG.md | 5 ++- README.md | 32 ++++++++++++-- autolog-aspectj/pom.xml | 4 +- .../aspects/AutoLogPerformanceAspect.java | 1 - .../AspectJLoggerManagerTest.java | 7 ++-- autolog-core/pom.xml | 2 +- autolog-coverage-reporting/pom.xml | 8 ++-- autolog-spring/pom.xml | 4 +- pom.xml | 42 +++++++++---------- 9 files changed, 65 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b61b14b..63d2c31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [1.2.0] - 2020-10-24 ### Added - Add a new module `autolog-aspectj` to allow usage of Autolog annotations in applications using AspectJ weaving. - Add the ability to use custom logger names instead of the default one (`"Autolog"`): @@ -51,6 +51,7 @@ annotations `@AutoLogMethodInput` or `@AutoLogMethodInOut`. ### Added - Initial release. -[Unreleased]: https://github.com/maximevw/autolog/compare/v1.1.0...HEAD +[Unreleased]: https://github.com/maximevw/autolog/compare/v1.2.0...HEAD +[1.2.0]: https://github.com/maximevw/autolog/releases/tag/v1.2.0 [1.1.0]: https://github.com/maximevw/autolog/releases/tag/v1.1.0 [1.0.0]: https://github.com/maximevw/autolog/releases/tag/v1.0.0 diff --git a/README.md b/README.md index 9b01b44..7bb4cb0 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ the following Maven dependencies: com.github.maximevw autolog-spring - 1.1.0 + 1.2.0 ``` * In an application using AspectJ weaving for logging automation by AOP: @@ -45,7 +45,7 @@ the following Maven dependencies: com.github.maximevw autolog-aspectj - 1.1.0 + 1.2.0 ``` * In a classic Java application, you can use logging methods provided by Autolog without automation by AOP (not @@ -54,7 +54,7 @@ recommended): com.github.maximevw autolog-core - 1.1.0 + 1.2.0 ``` @@ -99,7 +99,31 @@ In Spring Boot applications, the `LoggerManager` can be configured in the applic of `LoggerInterface` implementations to register in the property `autolog.loggers`) thanks to the auto-configuration class `AutologAutoConfiguration`. -### Basic example +### Usage with AspectJ weaving + +In order to use AspectJ weaving for logging automation by AOP, in addition to the dependency to `autolog-aspectj`, +ensure to have `org.aspectj:aspectjrt` in your classpath and to compile your application using AspectJ weaving, +including the dependency to `autolog-aspectj` in the weaved dependencies. + +At the starting of your application, insert the following code to instantiate the `LoggerManager` required by Autolog +for logging automation: +```java +public class HelloApplication { + public static void main(final String[] args) { + // Instantiate Autolog. + final LoggerManager loggerManager = new LoggerManager(); + // Register any loggers you want to use. See LoggerManager documentation for further details. + // loggerManager.register(...); + AspectJLoggerManager.getInstance().init(loggerManager); + + // Put the code of your application here... + } +} +``` + +Now, you can use Autolog annotations into your application. + +### Basic example with a Spring application Assuming your application is a REST API developed with Spring Web framework using an implementation of Slf4j for logging. diff --git a/autolog-aspectj/pom.xml b/autolog-aspectj/pom.xml index 070328e..59a017d 100644 --- a/autolog-aspectj/pom.xml +++ b/autolog-aspectj/pom.xml @@ -7,7 +7,7 @@ com.github.maximevw autolog - 1.1.0 + 1.2.0 autolog-aspectj @@ -20,7 +20,7 @@ com.github.maximevw autolog-core - 1.1.0 + 1.2.0 diff --git a/autolog-aspectj/src/main/java/com/github/maximevw/autolog/aspectj/aspects/AutoLogPerformanceAspect.java b/autolog-aspectj/src/main/java/com/github/maximevw/autolog/aspectj/aspects/AutoLogPerformanceAspect.java index a8ef894..0eb3c9b 100644 --- a/autolog-aspectj/src/main/java/com/github/maximevw/autolog/aspectj/aspects/AutoLogPerformanceAspect.java +++ b/autolog-aspectj/src/main/java/com/github/maximevw/autolog/aspectj/aspects/AutoLogPerformanceAspect.java @@ -28,7 +28,6 @@ import com.github.maximevw.autolog.core.logger.LoggingUtils; import com.github.maximevw.autolog.core.logger.MethodPerformanceLogEntry; import com.github.maximevw.autolog.core.logger.MethodPerformanceLogger; -import com.github.maximevw.autolog.core.logger.adapters.Log4j2Adapter; import com.github.maximevw.autolog.core.logger.performance.AdditionalDataProvider; import com.github.maximevw.autolog.core.logger.performance.PerformanceTimer; import org.apache.commons.lang3.StringUtils; diff --git a/autolog-aspectj/src/test/java/com/github/maximevw/autolog/aspectj/configuration/AspectJLoggerManagerTest.java b/autolog-aspectj/src/test/java/com/github/maximevw/autolog/aspectj/configuration/AspectJLoggerManagerTest.java index 6e98d60..16e945b 100644 --- a/autolog-aspectj/src/test/java/com/github/maximevw/autolog/aspectj/configuration/AspectJLoggerManagerTest.java +++ b/autolog-aspectj/src/test/java/com/github/maximevw/autolog/aspectj/configuration/AspectJLoggerManagerTest.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -48,7 +48,8 @@ class AspectJLoggerManagerTest { * provided by the {@link AspectJLoggerManager} singleton when it is not initialized. */ @Test - @Order(0) // Always run it first to be sure that the singleton has not been already initialized. + // Always run it first to be sure that the singleton has not been already initialized. + @Order(0) public void givenNoSpecificLoggerManager_whenGetLoggerManager_returnDefaultLoggerManager() { final LoggerManager loggerManager = AspectJLoggerManager.getInstance().getLoggerManager(); final List registeredLoggers = loggerManager.getRegisteredLoggers(); diff --git a/autolog-core/pom.xml b/autolog-core/pom.xml index 226f725..941f48d 100644 --- a/autolog-core/pom.xml +++ b/autolog-core/pom.xml @@ -7,7 +7,7 @@ com.github.maximevw autolog - 1.1.0 + 1.2.0 autolog-core diff --git a/autolog-coverage-reporting/pom.xml b/autolog-coverage-reporting/pom.xml index 9651fa2..bc34f70 100644 --- a/autolog-coverage-reporting/pom.xml +++ b/autolog-coverage-reporting/pom.xml @@ -7,7 +7,7 @@ autolog com.github.maximevw - 1.1.0 + 1.2.0 autolog-coverage-reporting @@ -33,17 +33,17 @@ com.github.maximevw autolog-core - 1.1.0 + 1.2.0 com.github.maximevw autolog-aspectj - 1.1.0 + 1.2.0 com.github.maximevw autolog-spring - 1.1.0 + 1.2.0 diff --git a/autolog-spring/pom.xml b/autolog-spring/pom.xml index b60c0d1..46921b9 100644 --- a/autolog-spring/pom.xml +++ b/autolog-spring/pom.xml @@ -7,7 +7,7 @@ com.github.maximevw autolog - 1.1.0 + 1.2.0 autolog-spring @@ -20,7 +20,7 @@ com.github.maximevw autolog-aspectj - 1.1.0 + 1.2.0 diff --git a/pom.xml b/pom.xml index 0e5a883..ff73b05 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.maximevw autolog - 1.1.0 + 1.2.0 pom Autolog @@ -84,41 +84,41 @@ 1.1.0 1.9.5 - 8.32 - 3.10 - 1.8 - 0.18 - 29.0-jre + 8.36.2 + 3.11 + 1.9 + 0.19 + 30.0-jre 2.2 - 2.11.0 - 2.11.0 - 0.8.5 + 2.11.3 + 2.11.3 + 0.8.6 2.1.6 - 5.6.2 - 1.6.2 + 5.7.0 + 1.7.0 1.4.200 2.0.0 2.13.3 1.2.3 - 6.3 - 1.18.12 - 1.18.10.0 + 6.4 + 1.18.16 + 1.18.16.0 3.1.1 3.1.0 3.8.1 3.0.0-M2 1.6 - 3.1.1 - 3.1.0 - 3.2.1 + 3.2.0 + 3.2.0 + 3.2.4 3.2.1 2.22.2 - 3.3.3 - 5.3.2 + 3.5.15 + 6.0.2 1.7.30 1.2.0 - 5.2.5.RELEASE - 2.2.6.RELEASE + 5.2.9.RELEASE + 2.3.4.RELEASE 1.7 2.0