Event Dispatcher  v0.1.6-beta.1
Project that offers a small library that allows to subscribe and fire events.
Log4jExample.java
Go to the documentation of this file.
1 package com.fermod;
2 
3 import java.util.concurrent.TimeUnit;
4 
5 import org.apache.logging.log4j.LogManager;
6 import org.apache.logging.log4j.Logger;
7 
8 public class Log4jExample {
9 
10  private static final Logger LOGGER = LogManager.getLogger(Log4jExample.class);
11  private static int count = 5;
12 
13  public static void main(String[] args) {
14 
15  while(count > 0) {
16  LOGGER.trace("Trace log message");
17  LOGGER.debug("Debug log message");
18  LOGGER.info("Info log message");
19  LOGGER.warn("Warn log message");
20  LOGGER.error("Error log message");
21  LOGGER.fatal("Fatal log message");
22  System.out.println();
23  count--;
24  try {
25  TimeUnit.SECONDS.sleep(1);
26  } catch (InterruptedException e1) {
27  e1.printStackTrace();
28  }
29  }
30 
31  }
32 
33 }
static void main(String[] args)
static final Logger LOGGER