[
https://issues.apache.org/jira/browse/LOG4NET-216?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stefan Bodewig updated LOG4NET-216:
-----------------------------------
Fix Version/s: (was: 1.2.11)
1.2 Maintenance Release
> Write a simple option parser for pattern converters
> ---------------------------------------------------
>
> Key: LOG4NET-216
> URL: https://issues.apache.org/jira/browse/LOG4NET-216
> Project: Log4net
> Issue Type: New Feature
> Components: Other
> Affects Versions: 1.2.11
> Reporter: Ron Grabowski
> Priority: Minor
> Fix For: 1.2 Maintenance Release
>
>
> There isn't a standard way of passing in more than just a single value into
> pattern converters:
> %logger{2}
> Create a simple parser that can split out the Option string:
> public class RepeatConverter : PatternConverter
> {
> protected override void Convert(TextWriter writer, object state)
> {
> SimpleOptionParser optionParser = new SimpleOptionParser(Option);
> char character = optionParser.GetChar("Character");
> int repeat = optionParser.GetInt("Repeat", 1); // defaults to 1
> writer.Write(new String(character, repeat));
> }
> }
> Where the pattern might look something like this in the config file:
> %repeat{Character:a,Repeat,10}
> that would be translated into:
> aaaaaaaaaa
> Are there more established ways of encoding multiple values in a string?
> %repeat{character:a;repeat:10}
> %repeat{character=a:char,repeat=10:int}
> ???
> Maybe this will allow the next next version of log4net to support nested
> patterns...
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira