title: Log4j Logging Based on Class
body: <p>I want to do logging based on class. I created something like this:</p>
  
  <pre><code>log4j.appender.cancellation=org.apache.log4j.RollingFileAppender
  log4j.appender.cancellation.MaxFileSize=10MB
  log4j.appender.cancellation.Threshold=INFO
  log4j.appender.cancellation.File=/logs/cancellation.log
  log4j.appender.cancellation.layout=org.apache.log4j.PatternLayout
  log4j.appender.cancellation.layout.ConversionPattern=%d %5p [%t] (%F:%L) - %m%n
  
  log4j.logger.com.mydomain.bean.CancellationBean=cancellation
  </code></pre>
  
  <p>and on my class:</p>
  
  <pre><code>private Logger logger = Logger.getLogger("com.mydomain.bean.CancellationBean");
  </code></pre>
  
  <p>but it doesn't work, any suggestion?</p>