You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Tom Crossland (JIRA)" <ji...@apache.org> on 2008/01/17 21:58:33 UTC

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

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
            Priority: Minor


<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.


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

Posted by "Tom Crossland (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12562182#action_12562182 ] 

Tom Crossland commented on LOG4NET-136:
---------------------------------------

Currently, the %logger pattern produces something like this for generic types:

   My.App.Package.TypeName`1[[My.App.Generic.ParameterTypeName, My.Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]

I think the trick here would be to first remove any assembly information (i.e. delete anything to the right hand side of any comma, including the comma itself). The remaining string will be of the following format:

   My.App.Package.TypeName`1[[My.App.Generic.ParameterTypeName

The %logger{n} pattern could then be applied both to the generic component class names to come up with something like:

  (if n == 2)  Package.TypeName<Generic.ParameterTypeName> 
  (if n == 1)  TypeName<ParameterTypeName>

The other (possibly better) option would be to remove the parameter type completely, i.e. delete everything to the right of a "[".

The only remaining issue would be the funny "`1", which I guess represents the number of parameters of the generic type.

Suggestions?

> 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
>            Priority: Minor
>
> <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.


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

Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4NET-136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ron Grabowski updated LOG4NET-136:
----------------------------------

    Fix Version/s: 1.2.11
         Assignee: Ron Grabowski

> 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
>
>
> <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.


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

Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12713849#action_12713849 ] 

Ron Grabowski commented on LOG4NET-136:
---------------------------------------

The csLogger class can test to see if the logger is a CLR generic type:

// Spring.Core.TypeResolution.GenericArgumentsHolder
private static readonly Regex ClrPattern = new Regex(
              "^"
              + @"(?'name'\w[\w\d\.]+)"
              + @"`\d+\s*\["
              + @"(?'args'(?>[^\[\]]+|\[(?<DEPTH>)|\](?<-DEPTH>))*(?(DEPTH)(?!)))"
              + @"\]"
              + @"(?'remainder'.*)"
              + @"$"
              , RegexOptions.CultureInvariant | RegexOptions.Compiled
            );

before it attempts to convert it to the more familiar C# < > syntax.

I'd like to keep the %csLogger{2} notation simple for now and apply the truncation to both the outer and inner classes. How about adding a property that removes the often redundant System prefix so this snippet of C#:

 private ILog log = LogManager.GetLogger(typeof(Company.WidgetManagement.Model.MyObject<int>));

will look like this in the log file:

 %csLogger{2,RemoveSystemPrefix=true}
 Model.MyObject<Int32>

instead of:

 Model.MyObject<System.Int32>

I keep referring to csLogger and vbLogger because we don't have a way of determining if the created Type was written in C# or VB. We have to put the burden on the person reading the logs. 

The person reading the logs must also be aware that the verboseness of the CLR generic type syntax was chosen for a reason and that by dumbing that syntax down to the simpler "List<MyObject>" you potentially loose out on knowing what exact version of MyObject (in terms of what versioned assembly it came from). Its probably a minor point for most people but its worth noting.

I think a string parser to convert the CLR notation into C#/VB notation is the way to go...

> 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.


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

Posted by "Chris Jerdonek (JIRA)" <ji...@apache.org>.
    [ 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.


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

Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4NET-136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ron Grabowski updated LOG4NET-136:
----------------------------------

    Attachment: ConsoleApplication3-GenericPrettyPrinter.zip

Sample code to convert:

System.Collections.Generic.Dictionary`2[[System.Collections.Generic.Dictionary`2[[System.Collections.Generic.List`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Collections.Generic.List`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Collections.Generic.List`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

into:

VB: Dictionary(Of Dictionary(Of List(Of Int32), List(Of String)), List(Of String))
CS: Dictionary<Dictionary<List<Int32>, List<String>>, List<String>> 

A better implementation might recursively parse the string instead of converting the string back into a Type then back into a string...

> 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.


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

Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712577#action_12712577 ] 

Ron Grabowski commented on LOG4NET-136:
---------------------------------------

I'm still surprised that I couldn't find example code that converts:

System.Collections.Generic.List`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

into:

VB: System.Collections.Generic.List(Of System.Int32)
CS: System.Collections.Generic.List<System.Int32>

My implementation converts the string back into a Type and recurses through it:

        private string recursiveGetShortTypeString(Type type, string openToken, string closeToken)
        {
            // base case 
            string result = _displayTypeFullName ? type.FullName : type.Name;

            if (type.IsGenericType)
            {
                // recursive case
                result = result.Substring(0, result.IndexOf(GENERIC_TOKEN)) + openToken;

                Type[] genericArguments = type.GetGenericArguments();
                for (int i = 0; i < genericArguments.Length; i++)
                {
                    Type genericArgument = genericArguments[i];

                    result += recursiveGetShortTypeString(genericArgument, openToken, closeToken);

                    if (i != genericArguments.Length - 1)
                    {
                        result += GENERIC_SEPERATOR;
                    }
                }

                result += closeToken;
            }

            return result;
        }

It handles complex generic objects:

System.Collections.Generic.Dictionary`2[[System.Collections.Generic.Dictionary`2[[System.Collections.Generic.List`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Collections.Generic.List`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Collections.Generic.List`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

VB: Dictionary(Of Dictionary(Of List(Of Int32), List(Of String)), List(Of String))
CS: Dictionary<Dictionary<List<Int32>, List<String>>, List<String>>

I also converted the library into a converter

<converter>
 <name value="csLogger" />
 <type value="ConsoleApplication3_GenericPrettyPrinter.CSharpLoggerPatternConverter, ConsoleApplication3-GenericPrettyPrinter" />
 </converter>

    public class CSharpLoggerPatternConverter : NamedPatternConverter
    {
        private readonly FullNameTypeConverter fullNameTypeConverter = new FullNameTypeConverter(true);

        protected override string GetFullyQualifiedName(LoggingEvent loggingEvent)
        {
            return fullNameTypeConverter.GetCSTypeString(loggingEvent.LoggerName);
        }
    }

that is based on the default LoggerPatternConverter (I made NamedPatternConverter non-internal): 

	internal sealed class LoggerPatternConverter : NamedPatternConverter 
	{
		override protected string GetFullyQualifiedName(LoggingEvent loggingEvent) 
		{
			return loggingEvent.LoggerName;
		}
	}

In theory you should be able to take advantage of the %logger{2} notation to limit class depth.

I suspect its faster to parse the generic type string instead of converting the string back into a Type. Will the Type always be loadable? 

Is that what you had in mind?


> 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.


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

Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712760#action_12712760 ] 

Ron Grabowski commented on LOG4NET-136:
---------------------------------------

My implementation attempts to convert the string type name into a real Type. This will fail when the logs are shipped to another app domain that cannot load the type. I'm investigating if Spring.Core.TypeResolution.GenericArgumentsHolder (Apache license) might be helpful. It parses the string without loading any Type information. 

> 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.


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

Posted by "Chris Jerdonek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599639#action_12599639 ] 

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

> Now that generics have been around a while has anyone come up with a "standard" way of parsing generic string type names?

Given that a logger name can be a potentially arbitrary string, for the purposes of %logger{n}, I would shy away from doing too much on the assumption that the name is the result of calling type.FullName.

I think it might be simplest to apply %logger{n}'s "right-most" rule only to the maximal initial substring that "looks like" a conventional class.  This can be simply the maximal initial consecutive segment of letters, numbers, underscores, and periods (since I believe letters, numbers, and underscores are the only characters that can be in a C# identifier.)

This would mean that the logger--

My.App.Package.TypeName`1[[My.App.Generic.ParameterTypeName, My.Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] 

would generate the following for the pattern %logger{1}:

TypeName`1[[My.App.Generic.ParameterTypeName, My.Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] 


On a related note, I'd also suggest that the group consider generating the default logger name for a type in a way other than simply calling type.FullName -- perhaps so it will look like "My.App.Package.TypeName<My.App.Generic.ParameterTypeName>" or "My.App.Package.TypeName<ParameterTypeName>", along the lines Tom was suggesting.  I was thinking about suggesting this even before seeing this issue.  That would be a nice convenience since .NET doesn't seem to provide a method or property like that already.


> 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
>            Priority: Minor
>
> <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.


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

Posted by "Chris Jerdonek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12713884#action_12713884 ] 

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

I agree that string parsing is better.

Would "RemoveSystemPrefix=true" be the first use of such a syntax in a log4net configuration, or are there already options like that?  It seems like a reasonable option.

If such a syntax is allowed, then perhaps the existing %logger pattern could be used instead.  There are already many similar pattern names: c, C, class, logger, type.  It could recognize a parameter like "GenericTypeFormat=CS".

Is the verboseness issue already an issue, since the version information etc is already left off for non-generic types?

The converter should also handle generic type names with unspecified type parameters.  These can arise, for example, as discussed here: https://issues.apache.org/jira/browse/LOG4NET-157 

I believe another way to get the type with unspecified parameters is as follows:

if (type.IsGenericType)
{
	genericType = type.GetGenericTypeDefinition();
}



> 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.


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

Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12561952#action_12561952 ] 

Ron Grabowski commented on LOG4NET-136:
---------------------------------------

Now that generics have been around a while has anyone come up with a "standard" way of parsing generic string type names? Are there methods in the Framework for doing it? What should the expected output be?

> 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
>            Priority: Minor
>
> <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.


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

Posted by "Tom Crossland (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12562184#action_12562184 ] 

Tom Crossland commented on LOG4NET-136:
---------------------------------------

Oh, I forgot to mention... The %class{n} pattern produced slightly better results.

> 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
>            Priority: Minor
>
> <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.