Excellent! Thanks Nicko.
-----Original Message----- From: Nicko Cadell [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 28, 2005 8:35 AM To: Log4NET User Subject: RE: Set Appender properties at run time? Jon, If you mean that you want to change the properties on your MsmqAppender that you have already configured then you can do something like this: foreach(log4net.Appender.IAppender appender in log4net.LogManager.GetRepository().GetAppenders()) { // Look for the appender you want to change. if (appender is MsmqAppender) { MsmqAppender myAppender = (MsmqAppender)appender; // Change value of properties myAppender.QueueName = "xxx"; myAppender.ActivateOptions(); } } Cheers, Nicko > -----Original Message----- > From: Jon Finley [mailto:[EMAIL PROTECTED] > Sent: 16 September 2005 13:42 > To: 'Log4NET User' > Subject: Set Appender properties at run time? > > Hi all, > > I have an MsmqAppender and would like to set the queueName property > (to which the message should be sent) at runtime. > Google turns up a few links that indicate that this is possible > (generically). Does anyone have a code snipped that does something > like this that you would be willing to share or point me to a > link/sample? > > Thanks much! > > Jon >
