title: Log4j2 logging to file and console
body: <p>I use <code>Log4j2 2.11.1</code> in my <code>Java</code> project to log to console and also to text file. I initialze it as follows:</p>
  
  <pre><code>private static Logger logger = LogManager.getLogger(readAllLinks.class);
  </code></pre>
  
  <p>I created <code>resources/log4j2.propertie</code>s file to set preferences.</p>
  
  <pre><code>name=PropertiesConfig
  property.filename = logs
  appenders = console, file
  appender.console.type = Console
  appender.console.name = STDOUT
  appender.console.layout.type = PatternLayout
  appender.console.layout.pattern = [%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
  appender.file.type = File
  appender.file.name = LOGFILE
  appender.file.fileName=${filename}/propertieslogs.log
  appender.file.layout.type=PatternLayout
  appender.file.layout.pattern=[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
  loggers=file
  logger.file.level = debug
  logger.file.appenderRefs = file
  logger.file.appenderRef.file.ref = LOGFILE
  rootLogger.level = debug
  rootLogger.appenderRefs = stdout
  rootLogger.appenderRef.stdout.ref = STDOUT
  </code></pre>
  
  <p><code>/logs/propertieslogs.log</code> file is created on filesystem, but it is empty. I tried it with all the log levels.</p>