A principal example showing how to setup logback to log each Java method to a separate file.
MT-safety and extra efficiency not guaranteed. Java 1.8+. Written by zencd, Aug 2019.
My article at Habr.com (in Russian).
- ✓ Separate log file per method
- ✓ Custom pattern per method
- ✓ Custom level threshold per method
- ✓ Custom variables in pattern
- ✓ Applicable to thread workers
- ✓ Reconfigurable in runtime
- ✓ Pure Java config
Run Main.java
.
Expect files method1.log
, method1x.log
, method2.log
and method2x.log
in the current directory.