public class Log extends Object
LogWriter
to do all the logging for a VM. The instance is created using
createLogWriter and accessed using getLogWriter.| Constructor and Description |
|---|
Log() |
| Modifier and Type | Method and Description |
|---|---|
static void |
cacheLogWriter()
Caches the singleton log writer so another log writer can be created.
|
static void |
closeLogWriter()
Closes the singleton log writer.
|
static com.gemstone.gemfire.LogWriter |
createLogWriter(String name,
String levelName)
Creates a singleton log writer that logs to stdout.
|
static com.gemstone.gemfire.LogWriter |
createLogWriter(String name,
String filePrefix,
boolean fileLogging,
String fileLogLevelName,
int fileMaxKBPerVM)
Creates a singleton log writer that logs to a file.
|
static com.gemstone.gemfire.LogWriter |
createLogWriter(String name,
String filePrefix,
String levelName,
boolean append)
Creates a singleton log writer that logs to a file.
|
static com.gemstone.gemfire.LogWriter |
createLogWriter(String name,
String filePrefix,
String levelName,
String dir,
boolean append)
Creates a singleton log writer that logs to a file in a specified directory.
|
static com.gemstone.gemfire.LogWriter |
getLogWriter()
Fetches the singleton log writer.
|
static String |
getLogWriterLevel()
Fetches the current log level of the singleton log writer.
|
static void |
main(String[] args)
Small Log test program
|
static void |
setLogWriterLevel(String levelName)
Resets the log level of the singleton log writer.
|
static com.gemstone.gemfire.LogWriter |
uncacheLogWriter(String name)
Uncaches the log writer with the specified name, blowing away the existing one
(unless it was previously cached).
|
public static com.gemstone.gemfire.LogWriter createLogWriter(String name, String levelName)
name - the name of the singleton log writer.levelName - only messages at this level or higher will be logged.HydraRuntimeException - if log writer has already been created.IllegalArgumentException - if level is illegal.public static com.gemstone.gemfire.LogWriter createLogWriter(String name, String filePrefix, String levelName, boolean append)
name - the name of the singleton log writer.filePrefix - the prefix for the name of the log file.levelName - only messages at this level or higher will be logged.append - whether to append to an existing log file.HydraRuntimeException - if log writer has already been created.IllegalArgumentException - if level is illegal.public static com.gemstone.gemfire.LogWriter createLogWriter(String name, String filePrefix, String levelName, String dir, boolean append)
name - the name of the singleton log writer.filePrefix - the prefix for the name of the log file.levelName - only messages at this level or higher will be logged.dir - the directory in which to create the log file.append - whether to append to an existing log file.HydraRuntimeException - if log writer has already been created.IllegalArgumentException - if level is illegal.public static com.gemstone.gemfire.LogWriter createLogWriter(String name, String filePrefix, boolean fileLogging, String fileLogLevelName, int fileMaxKBPerVM)
name - the name of the singleton log writer.filePrefix - the prefix for files created by this log writer.HydraRuntimeException - if file can't be created or if log writer has
already been created.IllegalArgumentException - if level is illegal.public static void closeLogWriter()
HydraRuntimeException - if the singleton log writer does not exist.public static void cacheLogWriter()
HydraRuntimeException - if the singleton log writer does not exist or
has already been cached.public static com.gemstone.gemfire.LogWriter uncacheLogWriter(String name)
name - the name of the log writer to uncache.HydraRuntimeException - if the named log writer does not exist or there
is already a singleton log writer.public static com.gemstone.gemfire.LogWriter getLogWriter()
HydraRuntimeException - if log writer has not been created.public static String getLogWriterLevel()
public static void setLogWriterLevel(String levelName)
public static void main(String[] args)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.