title: log4net use logger name in appender
body: <p>I am trying to clean up the logging configuration one of our applications currently uses for it's log4net implementation. The application is called with an argument containing the filepath to an XML file. That XML file includes various configuration information, one of which is the logger name to use. </p>
  
  <p>Currently, every configuration file has it's own logger, and every logger has their own appenders. As an example we would have:</p>
  
  <ul>
  <li>logger job1</li>
  <li>logger job2</li>
  <li>logger job3</li>
  </ul>
  
  <p>and </p>
  
  <ul>
  <li>appender consoleJob1</li>
  <li>appender consoleJob2</li>
  <li>appender consoleJob3</li>
  <li>appender rollingFileJob1</li>
  <li>appender rollingFileJob2</li>
  <li>appender rollingFileJob3</li>
  <li>appender smtpJob1</li>
  <li>appender smtpJob2</li>
  <li>appender smtpJob3</li>
  </ul>
  
  <p>Even though each of those appenders have nearly identical configurations. With hundreds of configuration files, this logging configuration section of the app.config is quite large. I believe I can consolidate most of these down to just a handful of generic appenders (Console, rollingFile, smtpToIT, smptpToSupport etc), and change each logger to use the generic appenders.</p>
  
  <p>A big roadblock to how I visualize this working, is that each appender would need to use the logger's name in the configuration somewhere. Is there a variable or setting I can use in an appender that will allow the appender to use the logger's name? For instance, the RollingFileAppender should log to '\log[loggername].txt' The smtpAppender should have a subject of 'Log for [loggername] on MM\DD\YYYY'.</p>
  
  <p>I took a look at <a href="http://logging.apache.org/log4net/release/config-examples.html" rel="nofollow">http://logging.apache.org/log4net/release/config-examples.html</a>, and believe I understand how the date can be added but I don't see anything about accessing the logger name from within the appender.</p>
  
  <p>Is there anyway to access a property of the logger being used within the appender? Further, am I understanding how log4net is meant to be configured, with appenders being re-used among multiple loggers? I hadn't heard of log4net until a few weeks ago so I might be going about this all wrong.</p>