Skip to content

Instantly share code, notes, and snippets.

@khannedy
Created September 26, 2011 06:53
Show Gist options
  • Save khannedy/1241743 to your computer and use it in GitHub Desktop.
Save khannedy/1241743 to your computer and use it in GitHub Desktop.
Basic Configuration Apache Log4j
/*
* Copyright (c) 2011, StripBandunk and/or its affiliates. All rights reserved.
*
* http://stripbandunk.com/
*
* STRIPBANDUNK PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package khannedy.belajar.belajarlog4j;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
/**
*
* @author Eko Kurniawan Khannedy
*/
public class BasicApp {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// Basic Configuration
BasicConfigurator.configure();
// Create Logger
Logger logger = Logger.getLogger(BasicApp.class);
logger.info("Simple log message");
// Shuwdown Logger
LogManager.shutdown();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment