bugzilla | 3 Oct 11:55
Favicon

DO NOT REPLY [Bug 45941] New: Custom PatternLayout

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

           Summary: Custom PatternLayout
           Product: Log4j
           Version: unspecified
          Platform: PC
               URL: http://logging.apache.org/log4j/1.2/apidocs/org/apache/l
                    og4j/PatternLayout.html
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Layout
        AssignedTo: log4j-dev <at> logging.apache.org
        ReportedBy: spamadore <at> gmail.com

For the moment, you can only use predefined patternLayout here

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

An evolution could be to add a system to define our own layout

basically a custom layout could be

---------------------------------------------------------
public class MyPidLayout implements CustomConversionLayout{

     char getConversionCharacter(){
            return 'y';
      }

     String getConversionValue(){
           return properties.getProperty("Pid"));
      }

}
----------------------------------------------------------

André Bergues

--

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

Gmane