Skip to content

Instantly share code, notes, and snippets.

@THUFIR
Created March 24, 2012 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save THUFIR/2180574 to your computer and use it in GitHub Desktop.
Save THUFIR/2180574 to your computer and use it in GitHub Desktop.
java logging
thufir@dur:~$
thufir@dur:~$ java -jar NetBeansProjects/GweneTest/dist/GweneTest.jar
Gwene...
...Gwene
thufir@dur:~$
thufir@dur:~$ cat NetBeansProjects/GweneTest/src/logs/GweneMain.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package logs;
import java.io.IOException;
import static java.lang.System.out;
import java.net.SocketException;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.LogManager;
import java.util.logging.Logger;
/**
*
* @author thufir
*/
public class GweneMain {
private static final Logger logger = Logger.getLogger(GweneMain.class.getName());
private static LogManager lMgr = LogManager.getLogManager();
private String logFile = "example";
private String oralog = "example2";
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
out.println("Gwene...");
logger.log(Level.INFO, "test log");
out.println("...Gwene");
}
}
thufir@dur:~$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment