See home page, Installation section, to add maven repositories.
Add in your pom.xml
the dependency artifacts.
<dependency> <groupId>net.sf.gee</groupId> <artifactId>g-logger</artifactId> <version>${g-logger.version}</version> </dependency>
FULL Class Diagram
Full description of classes with methods and attributes.
BRIEF Class Diagram
Bird-View of classes.
FInd the site generation of Maven with all informations about project and code, including Javadocs. Please see the Files section and choose your version and download site archive.
Site archive file has name as <libraryname>-<library_version>-SITE.tar.bz2
G-logger use a configuration file to auto-configure itself. Put in your classpath one text file named glog.properties
and see the options below:
glog.logger.type = UTIL, LOG4J, SLF4J glog.logger.file = <FILE_PATH_INSIDE_CLASSPATH>
Examples :
java.util.logging
glog.logger.type = UTIL glog.logger.file = my-java-util-file.properties
org.apache.log4j
glog.logger.type = LOG4J glog.logger.file = resources/my-log4j-file.properties
or
glog.logger.file = custom-log4j.xml
org.slf4j
glog.logger.type = SLF4J glog.logger.file = my-config-with-slf4j.properties
Log factory singleton that create dynamically your preferred logger.
GLogFactory.getInstance().getLogger( LOGGER.class, CLASS_TO_LOG.class ); GLogFactory.getInstance().getLogger( LOGGER.class, CLASS_TO_LOG.class, YourFormatter );
example
GLogFactory.getInstance().getLogger(SimpleLogger.class, MyCustomClass.class );
or
GLogFactory.getInstance().getLogger(SimpleLogger.class, MyCustomClass.class, new MyCustomerFormatter() );
The net.sf.gee.logger.log.SimpleGLogger
is the standard logger that have as output a String. Use net.sf.gee.logger.formatter.StringFormatter
.
The example of usage for this class:
final SimpleGLogger logger = GLogFactory.getInstance().getLogger(SimpleLogger.class, MyCustomClass.class);
Decide output class and craete a customer Logger
Create your class
public class YourLogger extends AbstractGLogger<YourOutput> implements GLogger<YourOutput> ...
Create your formatter
public class YourFormatter implements Formatter<YourOutput>