title: Log4j2 RollingFile Not Working
body: <p>I started using Log4j2 on the system i am currently developing.
  And I encountered some problems.</p>
  
  <p>here is my <strong>log4j2.properties</strong> file.</p>
  
  <pre><code>status = error
  name = PropertiesConfig
  
  filters = threshold
  
  filter.threshold.type = ThresholdFilter
  filter.threshold.level = debug
  
  appenders = console, rolling, list
  
  appender.console.type = Console
  appender.console.name = STDOUT
  appender.console.layout.type = PatternLayout
  appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
  
  appender.rolling.type = RollingFile
  appender.rolling.name = RollingFile
  appender.rolling.fileName = ${sys:catalina.home}/logs/beo.log
  appender.rolling.filePattern = ${sys:catalina.home}/logs/beo-%d{MM-dd-yy-HH-mm-ss}-%i.log
  appender.rolling.layout.type = PatternLayout
  appender.rolling.layout.pattern = %d %p %C{1.} [%t] %m%n
  appender.rolling.policies.type = Policies
  appender.rolling.policies.time.type = TimeBasedTriggeringPolicy
  appender.rolling.policies.time.interval = 2
  appender.rolling.policies.time.modulate = true
  appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
  appender.rolling.policies.size.size=100MB
  appender.rolling.strategy.type = DefaultRolloverStrategy
  appender.rolling.strategy.max = 5
  
  appender.list.type = List
  appender.list.name = List
  appender.list.filters = threshold
  appender.list.filter.threshold.type = ThresholdFilter
  appender.list.filter.threshold.level = error
  
  loggers = rolling
  
  logger.rolling.name = org.apache.logging.log4j.core.appender.rolling
  logger.rolling.level = debug
  logger.rolling.additivity = false
  logger.rolling.appenderRefs = rolling
  logger.rolling.appenderRef.rolling.ref = RollingFile
  
  rootLogger.level = info
  rootLogger.appenderRefs = stdout
  rootLogger.appenderRef.stdout.ref = STDOUT
  </code></pre>
  
  <p>Here is the <strong>login method</strong> where i tried to test logging.</p>
  
  <pre><code>private static final Logger LOGGER = LogManager
              .getLogger(NavigationController.class.getName());
  
  @RequestMapping(value = { "/", "/login" })
      public ModelAndView loginPage(
              @RequestParam(value = "error", required = false) String error,
              @RequestParam(value = "logout", required = false) String logout) {
  
          ModelAndView mv = new ModelAndView();
  
          Authentication auth = SecurityContextHolder.getContext()
                  .getAuthentication();
  
          if (!(auth instanceof AnonymousAuthenticationToken)) {
              mv.setViewName("redirect:/auth/panel");
  
          } else {
              if (error != null) {
                  mv.addObject("error", "Invalid username and password!");
                  LOGGER.debug("debug");
                  LOGGER.info("info");
                  LOGGER.error("error");
                  LOGGER.warn("warning");
                  LOGGER.fatal("fatal");
              }
              mv.setViewName("login");
          }
  
          return mv;
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/pWvIb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pWvIb.png" alt="enter image description here"></a></p>
  
  <p>The RollingFile doesn't seem to work. It creates a log file named beo.logs but it's also empty. Is there something wrong with my configuration?</p>