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/05/23 16:42:47 UTC

DO NOT REPLY [Bug 49329] New: Smart and compact formatting of package/class names.

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

           Summary: Smart and compact formatting of package/class names.
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Windows Vista
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Layout
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: joseph_schmidt71@yahoo.com


Please add support for smart compact formatting of package/class names in log
statements.
Below is an example of how it should look like:
http://lightbody.net/blog/2008/12/tip-compact-logging-in-java.html
(but for the jdk logging framework).
The same would be nice if would exist for log4j.

Even Nexus project has implemented something similar:
http://svn.sonatype.org/nexus/trunk/nexus/nexus-logging-extras/

This would be a great addition to log4j, making the log statements nicer, and
also while applications run in IDEs, it's much easier to follow what's
happening, since the tabular look of the output is kept this way in a
consistent manner.

-- 
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 49329] Smart and compact formatting of package/class names.

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

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

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

-- 
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 49329] Smart and compact formatting of package/class names.

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

--- Comment #2 from Curt Arnold <ca...@apache.org> 2010-05-24 09:29:38 EDT ---
EnhancedPatternLayout in either log4j 1.2.16 or the extras companion for log4j
1.2.15 and earlier, allows you to specify an abbreviation pattern for any names
(logger, class name, etc) as far as I can tell on a quick read, it does
everything described in the article.

http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/EnhancedPatternLayout.html

Change your layout class name from org.apache.log4j.PatternLayout to
org.apache.log4j.EnhancedPatternLayout, change your conversion pattern from %c
to %c{1.} and use log4j 1.2.16 or add the extras companion to the classpath and
you should be good to go.

-- 
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 49329] Smart and compact formatting of package/class names.

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

--- Comment #1 from Ralph Goers <Ra...@dslextreme.com> 2010-05-23 14:47:02 EDT ---
Code to do this is in my Log4j 2.0 experimental branch. However, the code that
does it was part of enhancements to the PatternLayout that Curt Arnold
provided. I can't say whether similar code exists in Log4j 1.x or how hard it
would be to backport.

-- 
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