An open API service indexing awesome lists of open source software.

https://github.com/ahus1/logging-and-tracing

Logging and Tracing - with Log4j and Zipkin
https://github.com/ahus1/logging-and-tracing

spring-sleuth zipkin

Last synced: about 1 year ago
JSON representation

Logging and Tracing - with Log4j and Zipkin

Awesome Lists containing this project

README

          

= Logging and tracing with Context - comparing Log4j and Zipkin

== About

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::
https://speakerdeck.com/ahus1/logging-and-tracing-with-context-information-log4j-zipkin-and-spring-sleuth

German slides::
https://speakerdeck.com/ahus1/logging-und-tracing-mit-kontextinformationen

English acticle published in Dutch Java User Group Java Magazine::
http://www.ahus1.de/pdf/16_19LoggingandTracingwithContextInformation.pdf[Logging and Tracing with Context Information]

German acticle published on Heise Developer::
https://www.heise.de/developer/artikel/Logging-und-Tracing-mit-Kontextinformation-fuer-Java-Entwickler-3686586.html[Logging und Tracing mit Kontextinformation für Java-Entwickler]

== Disclaimer

This code is presented as examples for learning and not as ready-to-use production code.

== Running the examples

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
----

== License

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.