Skip navigation links
GemFire XD 1.5.6-rc1

Package com.gemstone.persistence.logging

This package contains classes that implement a logging mechanism similar to the one in JDK 1.4.

See: Description

Package com.gemstone.persistence.logging Description

This package contains classes that implement a logging mechanism similar to the one in JDK 1.4. While the basic mechanism is present, many of the more advanced features (such as writing logs as XML and performing filtering) are not implemented.

Logger logger = Logger.getLogger("com.gemstone.persistence.jdo");
...
// Send logging output to a file, by default it will go to System.err
Handler handler = new StreamHandler(new FileOutputStream(file),
                                    new SimpleFormatter());
logger.addHandler(handler);
...
logger.warning("Could not find file: " + fileName);
...
// Ignore all messages that are lower than Level.INFO
logger.setLevel(Level.INFO);  
...
logger.throwing("com.gemstone.persistence.jdo.StateManagerImpl",
                "readFile", ex);
..
logger.info("Found these objects: ", objs);

A Logger's level may also be specified at runtime using a system propery. To set the level of the logger name "com.gemstone.persistence.jdo.Logger" to FINE use

-Dcom.gemstone.persistence.jdo.Logger.LEVEL=FINE

If the com.gemstone.persistence.logging.StackTraces system property is set to true, then a stack trace will be printed along with every message.

Skip navigation links
GemFire XD 1.5.6-rc1

Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.