|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcsli.util.logging.LoggingUtils
public class LoggingUtils
A basic interface to Log4J for simple uses.
First, configure the logging by passing a config file into the configuration method (see log4j docs for more info). Then, in your class, use the following code to get a logger. In this example, there would be one logger per class, which is a nice way of doing it but not required. You can name the logger however you want.
Logger logger = Logger.getLogger(YourClass.class);
Then you can log things one of the following loggin methods:
The configuration process can be complex, and I leave documentation up to the log4j docs, but at the very least, the following properties, put in the config file you pass in, will format the logs in a useful way and send them to STDOUT.
| Constructor Summary | |
|---|---|
LoggingUtils()
|
|
| Method Summary | |
|---|---|
static void |
configureLog4J()
This will configure Log4J based on the properties set in the specified config file - note that this should really only be called from main methods when processes are started. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LoggingUtils()
| Method Detail |
|---|
public static void configureLog4J()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||