Hey Nicko,

you may have noticed that you answered my recent question ("Finding out whether a specific appender is attached") with this, too (although I haven't tried it yet). Just two comments inline below:

Nicko Cadell wrote:

You can get all the current appenders by using a method like:

public static log4net.Appender.IAppender[] GetAllAppenders()
{
 ArrayList appenders = new ArrayList();

log4net.Repository.Hierarchy.Hierarchy h =
(log4net.Repository.Hierarchy.Hierarchy)log4net.LogManager.GetLoggerRepo
sitory();


Why do you assume that this ILoggerRepository is really a Hierarchy?

 appenders.AddRange(h.Root.Appenders);

foreach(log4net.Repository.Hierarchy.Logger logger in
h.GetCurrentLoggers())


Why do you assume that this ILog is really a Logger?

I usually tend to be quite careful with libraries written by other people when interfaces are in use. I assume that interfaces have been used for a reason, that reason being that it's not safe to assume that the actual object is always of some specific class type. Why else would I be using interfaces? In log4net, have interfaces been used for some other reason so it's safe to make assumptions about the classes implementing them?

Thanks,

              Oliver Sturm
--
omnibus ex nihilo ducendis sufficit unum
MSN [EMAIL PROTECTED] Jabber [EMAIL PROTECTED] ICQ 27142619


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to