Yeah, but the level at which I'm writing the test doesn't give me access to container initialization - its a high level story test. Thats why I want to have the option to log the whole story to my own appender so I can examine one one is failing. Is there really no way to do this except for with a log4net.config file?
On Aug 20, 7:44 am, Mauricio Scheffer <mauricioschef...@gmail.com> wrote: > I thought you wanted to inject a valid Castle.Core.Logging.ILogger in > your test, instead of the default NullLogger... you don't need the > container or the facility for that. > > On Aug 19, 11:47 pm, George Mauer <gma...@gmail.com> wrote: > > > > > Thanks Mauricio, > > At what point does the container get initialized and how do you add > > the facility then? Does calling the Log4netLogger constructor set > > some sort of global default? > > > On Aug 19, 7:09 pm, Mauricio Scheffer <mauricioschef...@gmail.com> > > wrote: > > > > 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 -~----------~----~----~----~------~----~------~--~---