« Return to Thread: [jira] Created: (LOG4NET-136) logger conversionPattern restriction doesn't work correctly for Generic classes

[jira] Commented: (LOG4NET-136) logger conversionPattern restriction doesn't work correctly for Generic classes

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View in Thread


    [ https://issues.apache.org/jira/browse/LOG4NET-136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12713753#action_12713753 ]

Chris Jerdonek commented on LOG4NET-136:
----------------------------------------

This looks great.  Thanks.  A couple quick comments:

Converting the string type name into a real type will also fail if the logger name does not correspond to a type (for example if the logger name is manually chosen to be something different using the LogManager.GetLogger(string) syntax).  So I would make sure there is graceful treatment of the failure-to-convert case.

I don't know off-hand what the correct behavior of the %logger{2} notation should be with respect to generic types (putting aside enhancing the notation).  The natural options seem to be (1) apply the truncation to only the outermost type, or (2) apply that same level of truncation to all types appearing anywhere in the string.  It might be good for the rule to be chosen so that it works independently of whether the string parsed to a type or not.


> logger conversionPattern restriction doesn't work correctly for Generic classes
> -------------------------------------------------------------------------------
>
>                 Key: LOG4NET-136
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-136
>             Project: Log4net
>          Issue Type: Bug
>    Affects Versions: 1.2.10
>         Environment: Windows 2000 Professional, .NET Framework 2.0
>            Reporter: Tom Crossland
>            Assignee: Ron Grabowski
>            Priority: Minor
>             Fix For: 1.2.11
>
>         Attachments: ConsoleApplication3-GenericPrettyPrinter.zip
>
>
> <conversionPattern value="%date %-5level %logger{1} - %message%newline"/>
> Using the above conversion pattern for a logger of a Generic class (i.e. My.System.MyClass<My.System.MyObject>) will result in the following log output:
> 2008-01-17 21:54:48,968 INFO  0, Culture=neutral, PublicKeyToken=null]] -  My error message
> Obviously, in this case it's not appropriate to just take the portion of the class name after the last '.' character.
> Thanks

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

 « Return to Thread: [jira] Created: (LOG4NET-136) logger conversionPattern restriction doesn't work correctly for Generic classes