Thanks! Wasn't sure if there was some way to do it like how Vivek describes it or not. But having another live logger to pull settings from will work for me.
On Wed, Jul 28, 2010 at 2:42 PM, Vivek R. Rathod <vrat...@appsecinc.com>wrote: > Yes, but this requires you to have a live logger defined in the config file > as opposed to just having an Appender defined. And, in case you are working > with the RollingFileAppender, when log4net loads the logger, it will touch > the file you specify, which you may not want. > -Vivek > ________________________________________ > From: Rob Richardson [rob.richard...@rad-con.com] > Sent: Wednesday, July 28, 2010 2:08 PM > To: Log4NET User > Subject: RE: Using an Appender as a Template > > Couldn't you have a sample logger defined in your config file, open that > in code, and then copy its settings into your dynamically created > appender? > > log4net.Repository.Hierarchy.Logger l = > LogManager.GetLogger(projectName).Logger as > log4net.Repository.Hierarchy.Logger > log4net.Appender.RollingFileAppender appender = new > log4net.Appender.RollingFileAppender(); > > Log4net.Repository.Hierarchy.Logger sample = > LogManager.GetLogger("SampleLog"); > appender.AppendToFile = sample.Appender["SampleAppender"].AppendToFile; > > RobR, probably showing his ignorance >