title: add custom propeties to log4j.properties file - java
body: <p>I want to add my property to the log4j.properties file.
  the porpety is call maxEvent and i do it like this : </p>
  
  <pre><code>log4j.appender.m=NewLog
  log4j.appender.m.File=m.log
  log4j.appender.m.layout=org.apache.log4j.PatternLayout
  log4j.appender.m.layout.ConversionPattern=%d{ISO8601} | %-5.5p %C(%L) | %m%n
  log4j.appender.m.MaxFileSize=10MB
  log4j.appender.m.MaxBackupIndex=5
  #my property
  log4j.appender.m.MaxEvents=3
  </code></pre>
  
  <p>when i access maxEvents in my code(int NewLog.java), it doesn't take it from the log4j.properties file</p>
  
  <p>EDIT</p>
  
  <p>in log4j file I have those methods:</p>
  
  <pre><code>public
  void setMaxEvents(int maxEvents) {
      this.maxEvents = maxEvents;
  }
  
  public
  int getMaxEvents() {
      return maxEvents;
  }
  </code></pre>
  
  <p>EDIT 2:
  full code og newlog:</p>
  
  <pre><code>package com.common.log;
  
  
  import org.apache.log4j.Priority;
  import org.apache.log4j.spi.LoggingEvent;
  import org.apache.log4j.RollingFileAppender;
  
  
  import java.util.ArrayList;
  
  public class NewLog extends RollingFileAppender {
  
  
  private circularArrayList&lt;LoggingEvent&gt; loggingEvents;
  
  
   private int maxEvents = 1; //default
  
  public
  NewLog() {
      super();
      loggingEvents = new circularArrayList&lt;&gt;(getMaxEvents());
  }
  
  
  
    @Override
      protected
      void subAppend(LoggingEvent event) {
  
               super.subAppend(event);
  
      }
  
  
  
      public
      void setMaxEvents(int maxEvents) {
          this.maxEvents = maxEvents;
      }
  
      public
      int getMaxEvents() {
          return maxEvents;
      }
  
  }
  </code></pre>