GitHub user bugraskl added a comment to the discussion: 
Assembly.GetEntryAssembly() can be null

For a default logger field, the usual pattern is still to use the class type 
directly:

```csharp
private static readonly ILog Log = LogManager.GetLogger(typeof(MyClass));
```

This is safe for static field initialization and gives the logger the class 
name. `LogManager.GetRepository().Name` is the repository name, not the current 
class name, so using it as the logger argument would create/use a logger with 
that repository name.

If you specifically want a string-based logger name, use 
`typeof(MyClass).FullName` (or another deliberate name) instead.

GitHub link: 
https://github.com/apache/logging-log4net/discussions/333#discussioncomment-18678156

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to