Details
-
New Feature
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.2.9, 1.2.10
-
None
Description
It would be really easy and nice, to hace the AssemblyLocationPatternConverter that would allow to retrieve the assembly of the Caller.
using System;
using System.Text;
using System.IO;
using log4net.Core;
namespace log4net.Layout.Pattern
{ internal sealed class AssemblyLocationPatternConverter : PatternLayoutConverter
{ override protected void Convert(TextWriter writer, LoggingEvent loggingEvent)
}
}
It just would need the retrieval of the Assembly Name in the LocationInfo (new property AssemblyName and the retrieval in the constructor)
...Retrieval....
m_assembly = method.Module.Assembly.FullName;
...
After this... it just would be needed to register the new pattern so that it would be recognized. (Added in the static constructor of PatternLayout)
....
s_globalRulesRegistry.Add("assembly", typeof(AssemblyLocationPatternConverter));
....
With a conversion pattern like the following
<conversionPattern value="%assembly"/>
We could get the following log:
WindowsFormsApplication3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null