You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2010/10/01 21:59:24 UTC

DO NOT REPLY [Bug 50039] New: Request: single character form of priority in PatternLayout

https://issues.apache.org/bugzilla/show_bug.cgi?id=50039

           Summary: Request: single character form of priority in
                    PatternLayout
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Layout
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: andrew@pimlott.net


Priorities are uniquely identified by their first character and this would keep
logs more compact.  However, this doesn't seem to be possible in PatternLayout
or EnhancedPatternLayout.  Suggest either a new conversion type, or a way to
truncate from the end.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 50039] Request: single character form of priority in PatternLayout

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50039

--- Comment #6 from Ceki Gulcu <ce...@apache.org> 2010-10-05 07:37:14 EDT ---
Scott's last comment (dated 2010-10-03 12:56:14 EDT) makes a very good and
rather constructive point.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 50039] Request: single character form of priority in PatternLayout

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50039

--- Comment #5 from Scott Deboy <sd...@iname.com> 2010-10-03 12:56:14 EDT ---
I'm fine with maintaining compatibility, but honestly, FormattingInfo seems
useless to end users (it happens to be public but doesn't have to be, and it is
final).

If there ever is a log4j 2.0, I would suggest we make explicit statements of
support for compatibility moving forward - specifically, I think we need to
define interfaces for anything we expect end users to want to extend and we
maintain those interface contracts, and everything else is implementation and
users should have no expectation of implementation classes going forward, even
if they are public.

log4j has been mired in its current state in large part (IMO) because of
resistance to modify the api due to concerns over backward compatibility.  Its
definitely a dis-incentive to participation if everything that is a public
class can only have additions made and never have things removed or changed.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 50039] Request: single character form of priority in PatternLayout

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50039

--- Comment #3 from Scott Deboy <sd...@iname.com> 2010-10-02 18:59:26 EDT ---
Updated patch to add missing break

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 50039] Request: single character form of priority in PatternLayout

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50039

--- Comment #2 from Scott Deboy <sd...@iname.com> 2010-10-02 18:59:04 EDT ---
Created an attachment (id=26112)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26112)
left-truncation patch (using syntax %+.2p for example) - updated (missed break
in case block)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Re: DO NOT REPLY [Bug 50039] Request: single character form of priority in PatternLayout

Posted by Scott Deboy <sc...@gmail.com>.
Also, this patch was created for the 'extras' companion - I didn't create a
patch that also added support for the same layout class in log4j proper (a
little confused why we have enhancedpatternlayout in both places)..

Scott

On Fri, Oct 1, 2010 at 10:44 PM, Scott Deboy <sc...@gmail.com> wrote:

> Log4j-dev folks:
>
> Please review the patch attached to this issue.  I threw this together to
> support logging the first X characters of something by using the + symbol.
>
> If a different style is preferred or if I did it wrong, let me know,
> otherwise I'll commit it (I've tested it with levels and it works fine).
>
> Scott
>
>
> On Fri, Oct 1, 2010 at 10:42 PM, <bu...@apache.org> wrote:
>
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=50039
>>
>> --- Comment #1 from Scott Deboy <sd...@iname.com> 2010-10-02 01:42:29
>> EDT ---
>> Created an attachment (id=26111)
>>  --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26111)
>> left-truncation patch (using syntax %+.2p for example)
>>
>> --
>> Configure bugmail:
>> https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
>> ------- You are receiving this mail because: -------
>> You are the assignee for the bug.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>>
>>
>

Re: DO NOT REPLY [Bug 50039] Request: single character form of priority in PatternLayout

Posted by Scott Deboy <sc...@gmail.com>.
Log4j-dev folks:

Please review the patch attached to this issue.  I threw this together to
support logging the first X characters of something by using the + symbol.

If a different style is preferred or if I did it wrong, let me know,
otherwise I'll commit it (I've tested it with levels and it works fine).

Scott

On Fri, Oct 1, 2010 at 10:42 PM, <bu...@apache.org> wrote:

> https://issues.apache.org/bugzilla/show_bug.cgi?id=50039
>
> --- Comment #1 from Scott Deboy <sd...@iname.com> 2010-10-02 01:42:29 EDT
> ---
> Created an attachment (id=26111)
>  --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26111)
> left-truncation patch (using syntax %+.2p for example)
>
> --
> Configure bugmail:
> https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are the assignee for the bug.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>
>

DO NOT REPLY [Bug 50039] Request: single character form of priority in PatternLayout

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50039

--- Comment #1 from Scott Deboy <sd...@iname.com> 2010-10-02 01:42:29 EDT ---
Created an attachment (id=26111)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26111)
left-truncation patch (using syntax %+.2p for example)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 50039] Request: single character form of priority in PatternLayout

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50039

--- Comment #7 from Curt Arnold <ca...@apache.org> 2010-10-28 02:03:47 EDT ---
Looked at it again, but can't integrate tonight.  The patch at least needs some
documentation in ExtendedPatternLayout and test case using the feature in
pattern layout.

Using the "+" sign for right truncation (the patch does right truncation
despite the name) is unsatisfying since "-" is used for left alignment (right
alignment is the default) and you can have a field that is left aligned and
right truncated and "%+-4C" doesn't look satisfying to me.    I haven't found
any examples of right or left truncation flags.  I thought about "*", but I'm
inclined to "!" at the moment.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 50039] Request: single character form of priority in PatternLayout

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50039

--- Comment #4 from Curt Arnold <ca...@apache.org> 2010-10-03 12:09:20 EDT ---
We voted to move EnhancedPatternLayout into log4j main, but it still needs to
be in extras for users who combine extras with earlier log4j's.

Looking at the patch, it looks like you changed a public constructor's
signature for FormattingInfo.  Since I think that is a released public class,
you can't change the signature, but you could add an additional constructor. 
Needing to change existing tests strongly suggests a breaking change.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 50039] Request: single character form of priority in PatternLayout

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50039

Curt Arnold <ca...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #8 from Curt Arnold <ca...@apache.org> 2010-10-28 23:39:03 EDT ---
Committed a patch using "!" as the right truncation modifier in rev 1028600.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org