NoahHabanero opened a new issue, #193:
URL: https://github.com/apache/logging-log4net/issues/193
It looks like there is a a bad interaction between log4net 3.0.1 and
log4net.Ext.Json 2.0.10.1
With error:
```
log4net:ERROR Failed to find type [log4net.Layout.PatternLayout,
log4net.Ext.Json]
System.TypeLoadException: Could not load type 'log4net.Layout.PatternLayout'
from assembly 'log4net.Ext.Json, Version=2.0.10.1, Culture=neutral,
PublicKeyToken=null'.
at System.Reflection.RuntimeAssembly.GetTypeCore(String typeName,
ReadOnlySpan`1 nestedTypeNames, Boolean throwOnError, Boolean ignoreCase)
at System.Reflection.TypeNameParser.GetType(String typeName,
ReadOnlySpan`1 nestedTypeNames, String assemblyNameIfAny)
at System.Reflection.TypeNameParser.Parse()
at System.Reflection.TypeNameParser.GetType(String typeName, Func`2
assemblyResolver, Func`4 typeResolver, Assembly requestingAssembly, Boolean
throwOnError, Boolean ignoreCase, Boolean extensibleParser)
at System.Type.GetType(String typeName, Boolean throwOnError, Boolean
ignoreCase)
at log4net.Util.SystemInfo.GetTypeFromString(Assembly relativeAssembly,
String typeName, Boolean throwOnError, Boolean ignoreCase)
at log4net.Util.SystemInfo.GetTypeFromString(String typeName, Boolean
throwOnError, Boolean ignoreCase)
at
log4net.Repository.Hierarchy.XmlHierarchyConfigurator.CreateObjectFromXml(XmlElement
element, Type defaultTargetType, Type typeConstraint)
```
Additionally, the issue with log4net.Util.PatternString using global
properties to set dynamic log names,
For example:
`<file type="log4net.Util.PatternString"
value="C:\Development\TestProjects\Log4NetExample\Logs\DDLogs\dd-%property{LogName}.json"
/>`
This is still not resolved with updates in 3.0.1, in this case, the log name
is dd-null where global property "LogName" is set in the main project like so:
`log4net.GlobalContext.Properties["LogName"] = "custom_log_" +
DateTime.Now.ToString("yyyyMMdd_HHmmss");`
Reference to duplicate issue:
#183, but now in version 3.0.1.
Please find a simple project implementation attached.
[Log4NetExample.zip](https://github.com/user-attachments/files/17363600/Log4NetExample.zip)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]