Java: a library that perfectly formats log output

I can’t find a library that allowed me to format the log output much better than usual. One of the features that I remember is that it can “compensate” for the log message depending on the “nesting” of where the log statement occurred.

That is, instead:

DEBUG | DefaultBeanDefinitionDocumentReader.java| 86 | Loading bean definitions
DEBUG | AbstractAutowireCapableBeanFactory.java| 411 | Finished creating instance of bean 'MS-SQL'
DEBUG | DefaultSingletonBeanRegistry.java| 213 | Creating shared instance of singleton bean 'MySQL'
DEBUG | AutowireCapableBeanFactory.java| 383 | Creating instance of bean 'MySQL'
DEBUG | AutowireCapableBeanFactory.java| 459 | Eagerly caching bean 'MySQL' to allow for resolving potential circular references
DEBUG | AutowireCapableBeanFactory.java| 789 | Another debug message

It will look something like this:

DEBUG | DefaultBeanDefinitionDocumentReader.java| 86  | Loading bean definitions
DEBUG | AbstractAutowireCapableBeanFactory.java | 411 | Finished creating instance of bean 'MS-SQL'
DEBUG | DefaultSingletonBeanRegistry.java       | 213 | Creating shared instance of singleton bean 'MySQL'
DEBUG | AutowireCapableBeanFactory.java         | 383 | Creating instance of bean 'MySQL'
DEBUG | AutowireCapableBeanFactory.java         | 459 | |__ Eagerly caching bean 'MySQL' to allow for resolving potential circular references
DEBUG | AutowireCapableBeanFactory.java         | 789 |     |__ Another debug message

This is the example I just compiled (VeryLongCamelCaseClassNamesNotMine). But I remember that I saw such a purely formatted output of the magazine, and they were much better than everything that I saw before, and, in addition to being just nicer, they are also easier to read, because they reproduced some logical organization of the code.

, .

, log4j sl4j.

+5
1

:

  • , "".

1. , , , . , , - , , , .

2. (. ), - " ", . , .

, ... , ...: - (

+1

All Articles