anchor.diff:  :hp-tags: java
   :hp-image: /images/logos/slf4j.png
   
  -I stumbled upon the term "structured logging" reading https://kartar.net/2015/12/structured-logging/[a 2015 blog post by James Turnbull], 
  -it's an interesting but not a new concept. 
  -I also discovered Python  and .Net developers had a library dedicated to *structured logging*: http://www.structlog.org[structlog] and https://serilog.net/[serilog].
  +I don't know who first coined the term *structured logging*.
  +There is https://kartar.net/2015/12/structured-logging/[a 2015 blog post by James Turnbull] to get started.
   
  -In this article I will describe how to do structured logging in Java with usual logging libraries like SLF4J et Logback.
  +Python and .Net developers have libraries dedicated to structured logging : http://www.structlog.org[structlog] and https://serilog.net/[serilog]. In this article I will describe how to do structured logging in Java with usual logging libraries like SLF4J et Logback.
   
   == Structured logging with SLF4J
   
  
positive.code: Compared to the Syslog, another popular log format, the JSON format
  
  * Can properly handle  multi-line logs like stack traces/call traces or messages containing line separators (wanted or not)
  * Can have custom fields like user Id, transaction Id 
  * Is more verbose, so compression (GZip or the like) may be required to reduce the weight
  
  Most popular log collection tools likes Filebeat, Graylog, Fluentd already use some kind of compressed JSON format under the hood.
  
negative.code: 	demoLogger.info("Hello world!");
  }
  ----
  It's better but still verbose.
  Hopefully, this kind of code won't make its way in your business code because it is usually hidden in an interceptor like a Servlet filter, a Spring aspect or a JAXRS interceptor. In Logback, there is a `MDCInsertingServletFilter` class which can serve as an example.
  
  
  == JSON logging with Logback
  