- 1, introduce the jar, annotate beans with @Logging
<dependency>
<groupId>io.bitryon</groupId>
<artifactId>bitryon-logger-spring-boot-starter</artifactId>
<version>1.0-SNAPSHOT</version> <!-- new version https://repo1.maven.org/maven2/io/bitryon/bitryon-logger-spring-boot-starter -->
</dependency>
-
2, configuration. see the explains in src/*/resource/application.xml, configure logger and app-node.
- import AutoConfigurationBitryonLogger.class to declare default Logging.
- If there is no configs from spring, it will go to LoggerFactory and bitryon_logger.properties to get the LoggerProvider as fallback
-
3, configure http client by adding LoggingHttpClientHeaderWriterInterceptor to write header HTTP_HEADER_STEP_LOG_ID(X-Step-Log-Id), so the next app/service/web-server can pick it up. See UserServiceSubscriber
-
4, configure web server by adding FilterRegistrationBean< LoggingHttpRequestWebFilter > to pick up header HTTP_HEADER_STEP_LOG_ID(X-Step-Log-Id) from the http request. See ExampleWebServerConfiguration