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 2005/12/23 08:18:06 UTC

DO NOT REPLY [Bug 38024] New: - Layout not compatible between 1.2 and 1.3

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38024>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38024

           Summary: Layout not compatible between 1.2 and 1.3
           Product: Log4j
           Version: 1.3alpha
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Layout
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: carnold@apache.org
OtherBugsDependingO 35452
             nThis:


The abstract method format changed signatures from String format(LoggingEvent event) in log4j 1.2 to 
format(Writer output, LoggingEvent event) in log4j 1.3 which means than any existing log4j 1.2 user 
supplied Layout will not longer compile and will likely result in a MethodNotFound if the new format 
method is called on a previous compiled.  Also HTMLFormat appears to be missing from 1.3.

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

---------------------------------------------------------------------
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 38024] - Layout not compatible between 1.2 and 1.3

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38024>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38024


carnold@apache.org changed:

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




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

---------------------------------------------------------------------
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 38024] - Layout not compatible between 1.2 and 1.3

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38024>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38024





------- Additional Comments From carnold@apache.org  2006-03-08 06:41 -------
In rev 384131, restored the PatternLayout.createPatternParser() extension point
and classes org.apache.log4j.helper.PatternParser, PatternConverter and
FormattingInfo needed to support user-provided custom PatternLayouts, but no
longer used by "stock" log4j.  

When using the "stock" PatternLayout, an instance of
org.apache.log4j.pattern.BridgePatternParser is returned by
createPatternParser() which bridges between the old API and the new log4j 1.3
implementation (o.a.l.pattern.PatternParser) which adds new features like
%logger and timezone specifiers.

Custom PatternLayout's will have extended the otherwise unused
o.a.l.helpers.PatternLayout and so will not transparently inherit the new log4j
1.3 features.

See http://marc.theaimsgroup.com/?l=log4j-dev&m=113991484525345&w=2 for a report
from the field from a user who observed the compatibility problem that was
anticipated in the previous comment.

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

---------------------------------------------------------------------
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 38024] - Layout not compatible between 1.2 and 1.3

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38024>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38024





------- Additional Comments From carnold@apache.org  2005-12-29 01:13 -------
There are several issues that are addressed in rev 359667.

1. Change to signature of abstract format method in Layout:

The signature of the abstract format method was changed from

String format(LoggingEvent event) 

to

void format(Writer output, LoggingEvent event) throws IOException

and the original method was provided by delegating to the new method.

While it would be good to redesign the class to have a Writer, StringBuilder or
StringBuffer as a parameter in 2.0, the only appender that directly used the new
signature was SyslogAppender and the Layout implementations had not been
modified to eliminate use of their static StringBuffers.  Basically, then only
thing that had changed is they had an output.write(sbuf.toString()) at the end.

Since the benefits of the changed signature had not been realized and the change
would break user provided layouts, it seemed best to revert to the 1.2 signature.

2. HTMLLayout had been moved to org.apache.log4j.html

This patch restores its previous package name.

3. o.a.l.helpers.DateLayout had been collapsed into o.a.l.TTCCLayout

This patch restores DateLayout (from the current TTCCLayout code) which could
have been used as a base class for user supplied layouts.  Both DateLayout and
TTCCLayout are marked as deprecated.

The only remaining Layout related incompatibility is with the
PatternLayout.createPatternParser which could have been overriden in derviatives
of PatternLayout to introduce custom format specifiers.  The implementation of
PatternLayout in 1.3 appears to be so significantly changed that restoring that
capability may be difficult.

All recently added unit tests from the 1.2 branch were ported with only minor
changes.  The MyPatternParser and MyPatternLayout tests which use the lost
PatternLayout.createPatternParser method were not ported.

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

---------------------------------------------------------------------
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 38024] - Layout not compatible between 1.2 and 1.3

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38024>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38024


carnold@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




------- Additional Comments From carnold@apache.org  2005-12-23 08:19 -------
Added additional unit tests to 1.2 branch in revision 358758.

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

---------------------------------------------------------------------
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 38024] - Layout not compatible between 1.2 and 1.3

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38024>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38024





------- Additional Comments From alelean@papermule.co.uk  2006-03-15 12:00 -------
Just to confirm this fix works in real life, as well as in Junit tests. With 
the layout specified in a log4j.properties file. 

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

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