Mark Womack wrote:

>>I believe that from the various options that Mike added only the
>>decimal separator and timezone should be retained.
> 
> 
> Why?  Why is the locale not useful in this case?

I was going to wait and see exactly what was retained, and what was not. 
  Then, if I felt strongly about an item, I would argue for it.

>>One possible idea is for the user to give directions about the
>>packages to search for. For example, if the users tells use to the
>>search the "com.foo" package and the convention world is "%hello", we
>>can attempt to locate the "com.foo.HelloPatternConverter" class. We
>>can assume that the list of packages to search for always includes the
>>"org.apache.log4j.xyz" package where xyz is yet to be determined.
> 
> 
> How will the user give directions about what package to search within?  Will
> this be encoded in the conversion pattern somehow?

This could be done in the configuration files as:

   #log4j.properties
   log4j.appender.A1.layout = org.apache.log4j.PatternLayout
   log4j.appender.A1.layout.ConversionPattern = \
       %date% [%thread%] %priority {minwidth=6, pad=RIGHT}% \
       %logger% %n% \t \
       %bar {someparam=something, anotherparam=somethingelse}% \
       %n% \t %message%
   log4j.appender.A1.layout.bar.PatternConverter = \
       org.myorg.foo.BarPatternConverter

   <!-- log4j-config.xml -->
   <layout class="org.apache.log4j.PatternLayout">
     <param name="ConversionPattern"
     <!-- The following is broken into 4 lines for the email systems -->
            value="%date% [%thread%] %priority {minwidth=6, pad=RIGHT}%
                  %logger% %n% \t
                  %bar {someparam=something, anotherparam=somethingelse}%
                  %n% \t %message%"
     />
     <map name="PatternConverter"
          key="bar"
          value="org.myorg.foo.BarPatternConverter"
     />
   </layout>


The XML option would require adding a map element to layout in the 
log4j.dtd, and defining the map element to contain a name (the name of 
the Map) and a key/value pair.

For any Pattern Id found in the map, the associated PatternConverter 
subclass would be instantiated and given the subparameters.

For any Pattern Id not found in the map, the default location (currently 
o.a.l.helpers) would be searched for the necessary subclass of 
PatternConverter, and then that class could be added to the map with its 
Pattern Id as the key.

The XML example points out the need for a continuation character in the 
Patterns (similar to the \ continuation character in properties files). 
  Perhaps a lone % as the last character in a line could indicate that 
parsing should continue on the next line, and leading whitespace on that 
line should be ignored.

-- 
Cheers,
Mike McAngus
[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to