Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is %-4relative in logback.xml log pattern specification

Tags:

spring

logback

What does %-4relative mean? I can't find a definition anywhere.

"%d{yyyy-MM-dd HH:mm:ss.SSS} %-4relative [%thread] %-5level %logger{35} - %msg%n" />

like image 419
Jack Peng Avatar asked Nov 08 '16 03:11

Jack Peng


People also ask

What is root level in Logback?

The possible levels are, in order of precedence: TRACE, DEBUG, INFO, WARN and ERROR. Each level has a corresponding method that we use to log a message at that level. If a Logger isn't explicitly assigned a level, it inherits the level of its closest ancestor. The root logger defaults to DEBUG.

How do I print the thread ID in Logback?

so just write %t on your configuration file in logback. xml reference document : Link and find Outputs the ID of the thread that generated the logging event. [%t] prints thread name not thread id with logback.


1 Answers

In logback %relative means print relative timestamp in milliseconds since the start of the aplication.

%-4 is just alignment of the element.

like image 174
Zbynek Vyskovsky - kvr000 Avatar answered Sep 29 '22 07:09

Zbynek Vyskovsky - kvr000