Log4j define length for combined pattern

150 Views Asked by At

Is it possible to define an overall length for in the layout pattern for the combination of two or more conversion characters?

Right now I use

<PatternLayout>
    <pattern>[%-5level] | {%c{1}::%M (line %4L)} | %msg%n</pattern>
</PatternLayout>

But I want to define the overall length (width) of the complete expression

 {%c{1}::%M (line %4L)}

How can this be achieved?

1

There are 1 best solutions below

0
On BEST ANSWER

That is impossible with patterns according to PatternLayout manual

You can test patterns here: online tester