The log file prints [jar] after the message

I have weird magazines from a magazine. All messages (each line) followed by [jar name]:

13:19:45 ERROR [coswsClass] lalalalal [module-version.jar] 

Sample:

 <pattern>%d{HH:mm:ss,SSS} %-5p [%c{3}] %m%n</pattern> 

I searched the logback site but found nothing. This suffix is ​​a messy stack, so how can I hide it?

PS Sorry for my English :)

+4
source share
3 answers

This is truly a feature, as others have noted. However, you can turn it off if necessary.

You can disable it by adding %ex to the end of the template, so %d %logger - %m%n should be rewritten as %d %logger - %m%n%ex . In your case, I think this should be the correct form if you want to disable it:

 <pattern>%d{HH:mm:ss,SSS} %-5p [%c{3}] %m%n%ex</pattern> 

This may even be necessary for some situations where this information causes significant overhead, although I would personally leave it and change the IDE or environment.

EDIT: yes, %ex documented .

+7
source

This function, part of the journal, prints packaging data — the origin of the class. So, you know exactly where and from which version this magazine came from.

http://logback.qos.ch/reasonsToSwitch.html

+1
source

This is a feature. In case of errors, logback gives the exact name of the flag from which the error occurs, which can be useful for diagnosing class problems. You can learn more about it here.

+1
source

Source: https://habr.com/ru/post/1435279/


All Articles