Hey Nicko,
Nicko Cadell wrote:
Interfaces have been used to allow alternative implementations to be
substituted. At the current time there are no alternative
implementations of ILoggerRepostiroy and ILogger in the log4net source,
however you could supply your own alternative implementation, which
w
Oliver,
> > log4net.Repository.Hierarchy.Hierarchy h =
> >(log4net.Repository.Hierarchy.Hierarchy)log4net.LogManager.Ge
> tLoggerRepository();
> >
> >
> Why do you assume that this ILoggerRepository is really a Hierarchy?
Currently the only implementation of the ILoggerRepository interface is
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
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();
a
Sure, here’s a quick code snippet .
.
This will get you the appenders that have
been appended to the root of the hierarchy.
IAppender fileApp = null;
IAppender consoleApp = null;
log4net.Repository.Hierarchy.Hierarchy
hierarchy = LogManager.GetLoggerRepository() as
log4net.Reposi