Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: Creating nested loggers in reverse order fails in 3.0.0-preview.1 #156

Closed
FreeAndNil opened this issue Jul 26, 2024 · 1 comment
Assignees
Milestone

Comments

@FreeAndNil
Copy link
Contributor

When creating nested loggers in reverse order

var child = LogManager.GetLogger("A.B.C");
var parent = LogManager.GetLogger("A.B")

you get

Message: 
System.InvalidCastException : Unable to cast object of type 'log4net.Repository.Hierarchy.ProvisionNode' to type 'log4net.Repository.Hierarchy.Logger'.

Stack Trace: 
<>c__DisplayClass32_0.<GetLogger>g__CreateLogger|1(Action1 extraInit) line 688 Hierarchy.GetLogger(String name, ILoggerFactory factory) line 679 Hierarchy.GetLogger(String name) line 317`

src/log4net/Repository/Hierarchy/Hierarchy.cs in b5f6ea2 #126

@FreeAndNil FreeAndNil added this to the 3.0.0 milestone Jul 26, 2024
@FreeAndNil FreeAndNil self-assigned this Jul 26, 2024
FreeAndNil added a commit that referenced this issue Jul 26, 2024
- shortened xml comments
- Hierarchy.EmittedNoAppenderWarning is now internal
FreeAndNil added a commit that referenced this issue Jul 29, 2024
…-creating-nested-loggers-in-reverse-order

#156 fixed Regression when creating nested loggers in reverse order
@FreeAndNil
Copy link
Contributor Author

Fixed in 3.0.0-preview.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant