Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Print a partitioned log4perl message with proper indent

by #perl_noob (Acolyte)
on Apr 17, 2017 at 06:37 UTC ( #1188089=perlquestion: print w/replies, xml ) Need Help??
#perl_noob has asked for the wisdom of the Perl Monks concerning the following question:

I am using log4perl for logging to a Screen Appender. The issue that I am facing is if there is a relatively large message, when it gets printed on the terminal, a word in broken down and printed in two separate lines like log4perl is printed as log4\nperl.

I am able to partition the message and it prints well. But when tags (%p %d %F etc.) are introduced before %m in pattern layout, it breaks the word while printing. I want to get the length of the contents that were printed before %m to modify the partition method accordingly.

Any leads would be helpful. Would prefer a way other than reserving characters for the placeholders since any one can change the pattern layout in the config file. Thank you.

  • Comment on Print a partitioned log4perl message with proper indent

Replies are listed 'Best First'.
Re: Print a partitioned log4perl message with proper indent
by Anonymous Monk on Apr 17, 2017 at 06:49 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1188089]
Front-paged by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2018-04-21 15:54 GMT
Find Nodes?
    Voting Booth?