There is a %notEmpty
pattern in Log4j2 which allows you to achieve exactly this.
%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %notEmpty{client=%X{client} }%m%n
There is a %notEmpty
pattern in Log4j2 which allows you to achieve exactly this.
%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %notEmpty{client=%X{client} }%m%n