Skip to content

jcalvopinam/sample-logback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a Sample of MDC - SLF4/LOG4J

  • The goal is add PID "Process Id" (dummy) to MDC logger (Mapped Diagnostic Context).
  • This is very useful when you want to attach some additional metadata to every line written-out to the logs.
  • The same logic you can use to log for example the user session Id.

You can test it from the CONSOLE, WEB or THREADS:

  • CONSOLE: print log on command line, run HomeConsole.java.
  • WEB: print log on command line, run mvn jetty:run and go to http://localhost:8080/sample-logback.
  • THREADS: print log on command line, run HomeThread.java.

Releases

No releases published

Packages

No packages published

Languages