This is an automated email from the ASF dual-hosted git repository.
davydm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4net.git
The following commit(s) were added to refs/heads/master by this push:
new b0470339 :sparkles: make it obvious that the derived appender is being
used
b0470339 is described below
commit b04703397e3bdc246e9d5746f2f3ecee2012e625
Author: Davyd McColl <[email protected]>
AuthorDate: Fri Jul 22 14:50:21 2022 +0200
:sparkles: make it obvious that the derived appender is being used
---
src/integration-testing/log4net-611-lib/DerivedAppender.cs | 6 ++++++
src/integration-testing/log4net-611-main/log4net.config | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/integration-testing/log4net-611-lib/DerivedAppender.cs
b/src/integration-testing/log4net-611-lib/DerivedAppender.cs
index a22b4267..2b1faebd 100644
--- a/src/integration-testing/log4net-611-lib/DerivedAppender.cs
+++ b/src/integration-testing/log4net-611-lib/DerivedAppender.cs
@@ -1,8 +1,14 @@
using log4net.Appender;
+using log4net.Core;
using log4net.Layout;
namespace log4net_611_lib;
public class DerivedAppender: RollingFileAppender
{
+ protected override void Append(LoggingEvent loggingEvent)
+ {
+ loggingEvent.Properties["appender-class-name"] =
nameof(DerivedAppender);
+ base.Append(loggingEvent);
+ }
}
\ No newline at end of file
diff --git a/src/integration-testing/log4net-611-main/log4net.config
b/src/integration-testing/log4net-611-main/log4net.config
index 77e850bb..5b444093 100644
--- a/src/integration-testing/log4net-611-main/log4net.config
+++ b/src/integration-testing/log4net-611-main/log4net.config
@@ -10,7 +10,7 @@
<preserveLogFileNameExtension value="true" />
<staticLogFileName value="false" />
<layout type="log4net.Layout.PatternLayout">
- <conversionPattern value="[file] %message%newline" />
+ <conversionPattern value="[file] %property{appender-class-name}
%message%newline" />
</layout>
<immediateFlush value="true" />
</appender>