Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Print a partitioned log4perl message with proper indent

by #perl_noob (Novice)
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
[choroba]: as my friend says, Ich stehe Deutsche ver nicht aber klein ;-)
[Corion]: Krug is generic pottery ware for pouring beverages, but a Bembel is painted with that blue paint and contains only (!) Apfelwein
[shmem]: Corion: alas, air too.
[Corion]: shmem: Yes, very sad!
[choroba]: doesn't sound much useful, which means I'll probably remember it
[karlgoethebier]: "that blue pain" == Salzglasur as far as i remember
[karlgoethebier]: Paint!
[shmem]: karlgoethebier the blue pain comes after all bembels are empty
[karlgoethebier]: Confusing "Bembel" with "Membel" might result in a slap in the face in Hesse...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2017-05-24 08:55 GMT
Find Nodes?
    Voting Booth?