[ 
https://issues.apache.org/jira/browse/LOG4J2-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16473667#comment-16473667
 ] 

Remko Popma edited comment on LOG4J2-2339 at 5/14/18 12:28 AM:
---------------------------------------------------------------

[[email protected]]

Yes, I want bunch of variable things padded or truncated to make them a fixed 
width - just for plesent visual look.

I would like to have sth like:  package.Class.method.line ends in the same 
place like below

{noformat}
DEBUG | com.acme.xxxxxxxxxxxxxxx.yyyyyyyyyyyy.FirstService.shortMethod:149  | 
here goes first message  
WARN  | com.acme.zzz.SecondSrv.secMethod:88                                 | 
here goes second message
INFO  | com.acme.shortpkg.Srv.verrrrrrrrryLonnnnnnnnnnnnnngMethoooooood:99  | 
but message visually starts in the same place
DEBUG | com.acme.Srv.method:1987                                            | 
package.Class.method.line ends in the same place
{noformat}

I would like  each pipe be exactly under pipe in each line

{code}
%-5.5p | %-60.60C.%-20.20M:%-4.4L  | %msg%n  isn't what I want
%-5.5p | %-70.70[C.M.L]  | %msg%n - I would like | C.M.L | take exactly 70 
characters - to be of fixed width, only last message is of variable length
{code}
 


was (Author: jakkub):
[[email protected]]

Yes, I want bunch of variable things padded or truncated to make them a fixed 
width - just for plesent visual look.

I would like to have sth like:  package.Class.method.line ends in the same 
place like below

DEBUG | com.acme.xxxxxxxxxxxxxxx.yyyyyyyyyyyy.FirstService.shortMethod:149  | 
here goes first message  

WARN  | com.acme.zzz.SecondSrv.secMethod:88                                     
                 | here goes second message

INFO    | com.acme.shortpkg.Srv.verrrrrrrrryLonnnnnnnnnnnnnngMethoooooood:99 | 
but message visually starts in the same place

DEBUG | com.acme.Srv.method:1987                                                
                          | package.Class.method.line ends in the same place

I would like  each pipe be exactly under pipe in each line

%-5.5p | %-60.60C.%-20.20M:%-4.4L  | %msg%n  isn't what I want

%-5.5p | %-70.70[C.M.L]  | %msg%n - I would like | C.M.L | take exactly 70 
characters - to be of fixed width, only last message is of variable length

 

> format multiple conversion characters with one conversion specifier
> -------------------------------------------------------------------
>
>                 Key: LOG4J2-2339
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2339
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: Core, Pattern Converters
>    Affects Versions: 2.8.2
>            Reporter: Jakub
>            Priority: Major
>
> I am writing on suggestion from [[email protected]] in 
> [https://stackoverflow.com/questions/50311762/log4j-set-class-and-method-summary-length-in-pattern]
>  
>  
> I would like to format multiple conversion characters with one conversion 
> specifier.
> As Remko explained, it is currently not possible
> _No, each modifier applies to one conversion. But Log4j could add a new 
> converter that means what you want. You can propose such a new converter on 
> the mailing list or issue tracker_
> Would it be a useful feature to add to log4j2 ? Would it be hard to implement 
> ?
>  
> EG
> I would like to set summary length of class.method.line with
> %-60.60CML
> It's not possible now. Below what doc states
> [https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html]
> {quote}Each conversion specifier starts with a percent sign (%) and is 
> followed by optional format modifiers and a conversion charact*er*. The 
> conversion charact*er* specifies the type of data
> The pattern parser knows when it has reached the end of a conversion 
> specifier when it reads a conversion charact*er*.
> {quote}
> It writes only about single conversion character, I would like to modify 
> multiple conversion characters with one conversion specifier.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to