Loginator is a project mainly written in ..., based on the MIT license.
Simplified logging proxy.
Simplified logging proxy for Java with support for log4j and Java Logging.
package example;
import com.frdna.loginator.Log;
public class MyExample {
// Instance method use
public void doSomething() {
Log.trace(this, "Getting ready to do some stuff.");
int count = 0;
try {
// Do some stuff for some things.
// ...
Log.debug(this, "Did some stuff for %s things.", count);
} catch (Exception e) {
Log.error(
this,
e,
"Caught an exception doing some stuff for some things.");
}
Log.info(this, "Finished doing things.");
}
// Class method use
public static void doSomeOtherStuff() {
Log.trace(MyExample.class, "Getting ready to do some other stuff.");
// Do some other stuff
// ...
Log.info(MyExample.class, "You get the idea.");
}
}
Include the log4j JAR and log4j.properties in your classpath. If you want to specify a configuration, you can use the "log4j.configuration" or "loginator.log4j.configuration" system property. If you want to specify a class to configure log4j, you can use the "log4j.configurationClass" system property.
Java Logging is enabled by default with the configuration in JAVA_HOME/lib/logging.properties unless a specified configuration can't be read. Java Logging configuration can be specified by setting the "java.util.logging.config.file" or "loginator.jdk.configuration" system property. A configuration class can be specified using the "java.util.logging.config.class" system property.
git clone https://github.com/freerangedata/loginator.git
cd loginator
git submodule update --init
rake dependencies # if you have curl
rake # build and test
Copyright (c) 2011 Free Range Data, LLC, released under the MIT license