Log4j writes to application log file instead of own log file
<p>Log4j writes to application log file instead of my own log file.
I tried to find a solution without editing the log4j.properties. Do I have to edit the config file? Why the lg file is not been created.</p>

<p>The app runs as a tomcat web app.</p>

<pre><code>import org.apache.log4j.Logger;
import org.apache.log4j.FileAppender;
import org.apache.log4j.Level;
import org.apache.log4j.SimpleLayout;


public class ArchiveJanitor extends SecureResource {

private static final Logger logger =  org.apache.log4j.Logger.getRootLogger();

public ArchiveJanitor(Context context, Request request, Response response) {
        super(context, request, response);
        try {
            SimpleLayout layout = new SimpleLayout();
            FileAppender fileAppender = new FileAppender( layout, "logs/Janitor.log", false );
            logger.addAppender(fileAppender);
            logger.setLevel((Level) Level.ALL);
        }catch (IOException e){
            logger.error(e.toString());
        }
    }
   public void doSmth(){
      logger.error("error ....")
   }

}
</code></pre>