log4j: how do you left pad BOTH class and method

K

korosh

I want:

[myclass.mymethod ] - logging statement 1
[myclass.mymethod ] - logging statement 2
[myclass.mymethod ] - logging statement 3


I have used :
log4j.appender.A1.layout.ConversionPattern=[%d{HH:mm:ss.SSS}] [%p]
[%-10c.%M] - %m%n

which gives me:

[myclass .mymethod] - logging statement 1
[myclass .mymethod] - logging statement 2
[myclass .mymethod] - logging statement 3

I have also tried:

[%-10c.-10%M]
[-10{%c.%M}]


none give me what I want which is:

[myclass.mymethod ] - logging statement 1

help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top