How about this: BasicConfigurator.Configure(); // to initialize log4net (by default outputs to console) ILog log = LogManager.GetLogger("testLogger"); ILogger logger = new Castle.Services.Logging.Log4netIntegration.Log4netLogger(log.Logger, null); var svc = new MyService {Logger = logger}; // rest of test...
On Aug 19, 4:53 pm, George Mauer <gma...@gmail.com> wrote: > I am writing story/integration/acceptance tests that basically run > through my application with a mocked database and UI. In my > application I make HEAVY use of log4net with the loggers being > injected by the log4net integration facility. > > For the purposes of my tests I would like to be able to set the > log4net appender to output to the Output window. Preferably I would > like to do this without having to create a log4net xml file. Is there > an easy way to tell log4net integration to use the ConsoleAppender() > instead of the one it uses by default when no xml file is provided (I > assume it is the NullLogger)? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to castle-project-users@googlegroups.com To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---