Created
June 18, 2014 19:15
-
-
Save dalmat36/8b9d74c97993380f5d43 to your computer and use it in GitHub Desktop.
Simple Log4j example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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