Skip to content

Instantly share code, notes, and snippets.

@dalmat36
Created June 18, 2014 19:15
Show Gist options
  • Select an option

  • Save dalmat36/8b9d74c97993380f5d43 to your computer and use it in GitHub Desktop.

Select an option

Save dalmat36/8b9d74c97993380f5d43 to your computer and use it in GitHub Desktop.
Simple Log4j example
import org.apache.log4j.Logger;
import org.apache.log4j.BasicConfigurator;
public class TestLog4j {
static Logger logger = Logger.getLogger("JTST");
public static void main(String[] args) {
// TODO Auto-generated method stub
try
{
BasicConfigurator.configure();
logger.info("");
logger.info("Logger Works!");
logger.info("");
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment