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

Dominik Psenner commented on LOG4NET-580:
-----------------------------------------

Thanks for sharing the insights how your team uses log4net. It is always nice 
to know the point of view of someone else. Thinking of your usecase, I vote for 
implementing the logic what proper logger names are in your application code. 
The framework could also modify the logger name to allow creating a hierarchy 
of loggers as you suggested, but I'm sure that not interpreting input with 
guesswork is better in this scenario.

That said I've pushed a 
[changeset|https://github.com/apache/logging-log4net/commit/3c4de1c2337bbee0b44ef4e3dfded56aff6a2218]
 that improves the exception message. CI [has kicked 
in|https://builds.apache.org/view/L/view/Logging/job/logging-log4net/job/feature%252Ffix-LOG4NET-580/]
 and is going to build and test the changes. To give anyone time to review the 
changes I'll not merge them into develop before 72 hours have passed.

> ArgumentOutOfRangeException - When logger name begins with character '.'
> ------------------------------------------------------------------------
>
>                 Key: LOG4NET-580
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-580
>             Project: Log4net
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.15, 2.0.6, 2.0.7, 2.0.8
>            Reporter: Timothy Fuller
>
> When you try to get a logger and supply a name which begins with the '.' 
> character for example ".Test" the code crashes in :     at 
> log4net.Repository.Hierarchy.Hierarchy.UpdateParents(Logger log)
> System.ArgumentOutOfRangeException: Index was out of range. Must be 
> non-negative and less than the size of the collection.
> Parameter name: startIndex
>    at System.String.LastIndexOf(Char value, Int32 startIndex, Int32 count)
>    at log4net.Repository.Hierarchy.Hierarchy.UpdateParents(Logger log)
>    at log4net.Repository.Hierarchy.Hierarchy.GetLogger(String name, 
> ILoggerFactory factory)
>    at log4net.Repository.Hierarchy.Hierarchy.GetLogger(String name)
>    at log4net.Core.LoggerManager.GetLogger(String repository, String name)
>    at log4net.LogManager.GetLogger(String repository, String name)
>  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to