I am not sure if I understand your goal, but if you want your appender to be configurable you basically have to expose a property on your appender. Then you can either set this property either programmatically or in the configuration file.
The UdpAppender exposes a property like this:
public int LocalPort
{
get; set;
}
(It is actually a bit more complex as they check if the value in the setter is a valid port.)
In the configuration file you use it like this:
<localPort value="8080" />
This works very well for simple types like string, int ... but also for some complex types like IPAddress
. If you have your own type then it will be more difficult to make it work and I would have to check first how this is done.