Skip to content

IndexOutOfRangeException when creating child loggers multithreaded #197

@FreeAndNil

Description

@FreeAndNil

When creating many loggers in different threads an there is no parent logger (yet), you will get an IndexOutOfRangeException with 3.0 upwards.

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Collections.Generic.List`1.Add(T item)
   at log4net.Repository.Hierarchy.Hierarchy.UpdateParents(Logger log)
   at log4net.Repository.Hierarchy.Hierarchy.TryCreateLogger(LoggerKey key, ILoggerFactory factory)
   at log4net.Repository.Hierarchy.Hierarchy.GetLogger(String name, ILoggerFactory factory)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions