This is an examples project for logging and tracing with Log4j and Zipkin.
This is an add-on to a talk I presented.
- English slides
- German slides
-
https://speakerdeck.com/ahus1/logging-und-tracing-mit-kontextinformationen
- English acticle published in Dutch Java User Group Java Magazine
- German acticle published on Heise Developer
-
Logging und Tracing mit Kontextinformation für Java-Entwickler
During my talks I usually run the examples from my IntelliJ IDE. Matching run configurations are part of this repository. This makes it easy to explore and debug them.
Once the examples run you can point your browser to the following URL: http://localhost:8080/
To run the Zipkin example you’ll need to have a Zipkin server up-and-running (for testing an instance started with Docker will do).
You can run the examples from the command line like this:
mvn -am -pl 10_simple spring-boot:run mvn -am -pl 20_programmatic_mdc spring-boot:run mvn -am -pl 30_interceptors spring-boot:run mvn -am -pl 40_sleuth spring-boot:run
The last example runs two services on different ports in two different processes. Therefore two commands are necessary to be run in different terminals:
mvn -am -pl 50_zipkin spring-boot:run mvn -am -pl 50_zipkin spring-boot:run@run-external
Copyright 2016-2017 Alexander Schwartz
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
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. See the License for the specific language governing permissions and limitations under the License.