Dmitri Tchikine (JIRA | 26 May 2012 08:13
Picon
Favicon

[jira] [Created] (LOG4NET-343) ArgumentOutOfRangeException in log4net hierarchy on "." logger name

Dmitri Tchikine created LOG4NET-343:
---------------------------------------

             Summary: ArgumentOutOfRangeException in log4net hierarchy on "." logger name
                 Key: LOG4NET-343
                 URL: https://issues.apache.org/jira/browse/LOG4NET-343
             Project: Log4net
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.2.11
         Environment: Windows 32 bit, .NET 3.5 SP 1
            Reporter: Dmitri Tchikine
            Priority: Minor

While configuring a logger with name ".", however wrong it may be, I stampled on uncaught exception.
"Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex"
The problem code is at the first executable code line of UpdateParents(Logger log) method
of log4net.Repository.Hierarchy.Hierarchy class.

I am sure there is an easy fix.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

Dominik Psenner (JIRA | 26 May 2012 16:09
Picon
Favicon

[jira] [Assigned] (LOG4NET-343) ArgumentOutOfRangeException in log4net hierarchy on "." logger name


     [
https://issues.apache.org/jira/browse/LOG4NET-343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dominik Psenner reassigned LOG4NET-343:
---------------------------------------

    Assignee: Dominik Psenner

> ArgumentOutOfRangeException in log4net hierarchy on "." logger name
> -------------------------------------------------------------------
>
>                 Key: LOG4NET-343
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-343
>             Project: Log4net
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.11
>         Environment: Windows 32 bit, .NET 3.5 SP 1
>            Reporter: Dmitri Tchikine
>            Assignee: Dominik Psenner
>            Priority: Minor
>
> While configuring a logger with name ".", however wrong it may be, I stampled on uncaught exception.
> "Index was out of range. Must be non-negative and less than the size of the collection.
> Parameter name: startIndex"
> The problem code is at the first executable code line of UpdateParents(Logger log) method
> of log4net.Repository.Hierarchy.Hierarchy class.
> I am sure there is an easy fix.

(Continue reading)

Dominik Psenner (JIRA | 26 May 2012 16:11
Picon
Favicon

[jira] [Updated] (LOG4NET-343) ArgumentOutOfRangeException in log4net hierarchy on "." logger name


     [
https://issues.apache.org/jira/browse/LOG4NET-343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dominik Psenner updated LOG4NET-343:
------------------------------------

    Attachment: LOG4NET-343.patch

Unfortunately you did not provide a test case. Would you please check if this patch solves this issue?

> ArgumentOutOfRangeException in log4net hierarchy on "." logger name
> -------------------------------------------------------------------
>
>                 Key: LOG4NET-343
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-343
>             Project: Log4net
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.11
>         Environment: Windows 32 bit, .NET 3.5 SP 1
>            Reporter: Dmitri Tchikine
>            Assignee: Dominik Psenner
>            Priority: Minor
>         Attachments: LOG4NET-343.patch
>
>
> While configuring a logger with name ".", however wrong it may be, I stampled on uncaught exception.
> "Index was out of range. Must be non-negative and less than the size of the collection.
> Parameter name: startIndex"
(Continue reading)

Dmitri Tchikine (JIRA | 29 May 2012 06:48
Picon
Favicon

[jira] [Commented] (LOG4NET-343) ArgumentOutOfRangeException in log4net hierarchy on "." logger name


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

Dmitri Tchikine commented on LOG4NET-343:
-----------------------------------------

The actual test case was that this code does not throw any exception:

> ArgumentOutOfRangeException in log4net hierarchy on "." logger name
> -------------------------------------------------------------------
>
>                 Key: LOG4NET-343
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-343
>             Project: Log4net
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.11
>         Environment: Windows 32 bit, .NET 3.5 SP 1
>            Reporter: Dmitri Tchikine
>            Assignee: Dominik Psenner
>            Priority: Minor
>         Attachments: LOG4NET-343.patch
>
>
> While configuring a logger with name ".", however wrong it may be, I stampled on uncaught exception.
> "Index was out of range. Must be non-negative and less than the size of the collection.
> Parameter name: startIndex"
> The problem code is at the first executable code line of UpdateParents(Logger log) method
(Continue reading)

Dmitri Tchikine (JIRA | 29 May 2012 06:55
Picon
Favicon

[jira] [Comment Edited] (LOG4NET-343) ArgumentOutOfRangeException in log4net hierarchy on "." logger name


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

Dmitri Tchikine edited comment on LOG4NET-343 at 5/29/12 4:54 AM:
------------------------------------------------------------------

The actual test case was that this code does not throw any exception:
  log4net.LogManager.GetLogger(".");

But of cause, there are more test cases:
 1) Any of these calls should not through exceptions either:
      log4net.LogManager.GetLogger("..A");
      log4net.LogManager.GetLogger("B....A");
 2) And it should be possible to configure a logger with one character name, and use it, so that a code like this
would actually log a message:
      log4net.LogManager.GetLogger("A").Info("test");

I am afraid that a fix, which simply ignores 1-character strings, does not meet such expectations.

      

      was (Author: dmitri):
    The actual test case was that this code does not throw any exception:

> ArgumentOutOfRangeException in log4net hierarchy on "." logger name
> -------------------------------------------------------------------
>
>                 Key: LOG4NET-343
(Continue reading)

Stefan Bodewig (JIRA | 2 Jun 2012 21:17
Picon
Favicon

[jira] [Resolved] (LOG4NET-343) ArgumentOutOfRangeException in log4net hierarchy on "." logger name


     [
https://issues.apache.org/jira/browse/LOG4NET-343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Bodewig resolved LOG4NET-343.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.2.12
         Assignee: Stefan Bodewig  (was: Dominik Psenner)

fixed with svn revision 1345560

> ArgumentOutOfRangeException in log4net hierarchy on "." logger name
> -------------------------------------------------------------------
>
>                 Key: LOG4NET-343
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-343
>             Project: Log4net
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.11
>         Environment: Windows 32 bit, .NET 3.5 SP 1
>            Reporter: Dmitri Tchikine
>            Assignee: Stefan Bodewig
>            Priority: Minor
>             Fix For: 1.2.12
>
>         Attachments: LOG4NET-343.patch
>
(Continue reading)


Gmane