Yes. You can implement the log4net.Appender.IAppender interface to create you own customized appender. We recommend that you extend the log4net.Appender.AppenderSkeleton class rather than starting from scratch. You should implement your custom code in a assembly separate from the log4net assembly. To get started it is worth looking at the source of the log4net.Appender.TraceAppender as an example of the minimum amount of code required to get an appender working.
To configure log4net to use your custom appender you need to specify the assembly qualified name of the appender type in the config file. For example:
<appender name="..." type="MyNamespace.MyAppender, MyAssembly"> The .NET runtime will try to locate the assembly called MyAssembly. How .NET locates assemblies is beyond the scope of this FAQ.
But there are some other issues. I am a mac user and under Example title it says "This is a skeleton target that writes messages to the specified host. Compile using:
csc.exe /t:library /out:MyAssembly.dll /r:NLog.dll MyFirstTarget.cs"
What I've done so far is creation of target class including TargetFactory.AddTarget(..) in its constructor, and config file mentioned on the page.
I tried to use ConfigurationItemFactory.Default.Targets.RegisterDefinition(...), but it gives an error.
And I created an target class via "... public sealed class ANC : TargetWithLayout ..." I put "onfigurationItemFactory.Default.Targets.RegisterDefinition("ANC", typeof(Logging.NLogTarget.ANC));" into my main method and some other logging statements but I got the following error: ".../Logging/Main.cs(25,25): Error CS0103: The name `ConfigurationItemFactory' does not exist in the current context (CS0103) ()"