Package com.portal.pcm
Class ErrorLog
java.lang.Object
com.portal.pcm.Log
com.portal.pcm.ErrorLog
ErrorLog presents a Java interface for the PCM library error log.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from class com.portal.pcm.Log
CONTROL_BY_FLAG, CONTROL_BY_PRIORITY, m_sdf, NEWLINE, NO_LOG_CONTROL, STATE_FLAG_ALL, STATE_FLAG_NONE, STATE_PRIORITY_HIGHEST, STATE_PRIORITY_LOG_ALL, STATE_PRIORITY_LOG_NONE, STATE_PRIORITY_LOWEST
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ErrorLog
Returns the default error log object.void
Logs information to the log file.void
Logs information to the log file.protected void
openLog()
void
setFlags
(int flags) Sets the log flags.void
setInMemoryFlag
(int value) Sets the inMemorylogflag.void
setInMemorySize
(long logsize) Sets the inMemorylogsize.Methods inherited from class com.portal.pcm.Log
close, controlToString, doLog, getControlState, getControlStyle, getLog, getMessageHeader, getName, isLogInMemory, log, log, log, log, log, setControlState, setControlStyle, setInMemoryFlagValue, setInMemoryLogSize, setName, setNames, setNames, setPath, setWriter
-
Field Details
-
Assertion
public static final int Assertion- See Also:
-
Error
public static final int Error- See Also:
-
Warning
public static final int Warning- See Also:
-
Debug
public static final int Debug- See Also:
-
Errno
public static final int Errno- See Also:
-
Message
public static final int Message- See Also:
-
Dump
public static final int Dump- See Also:
-
Security
public static final int Security- See Also:
-
All
public static final int All- See Also:
-
Serious
public static final int Serious- See Also:
-
TimingInfoError
public static final int TimingInfoError- See Also:
-
TimingInfoWarn
public static final int TimingInfoWarn- See Also:
-
-
Constructor Details
-
ErrorLog
public ErrorLog()Constructs an instance ofErrorLog
. By default will log to the current directory using log namedjavapcm.log
. -
ErrorLog
Constructs an instance ofErrorLog
from a path, application name, and logging flags.- Parameters:
path
- The path for the log file.name
- The name of the application doing the logging.flags
- Log control flags.
-
ErrorLog
Constructs an instance ofErrorLog
from a path.- Parameters:
path
- The path for the log file.
-
-
Method Details
-
setFlags
public void setFlags(int flags) Sets the log flags.- Parameters:
flags
- The new log flags.
-
setInMemoryFlag
public void setInMemoryFlag(int value) Sets the inMemorylogflag.- Parameters:
value
- - value
-
setInMemorySize
public void setInMemorySize(long logsize) Sets the inMemorylogsize.- Parameters:
logsize
- - log size
-
log
Logs information to the log file.- Parameters:
message
- the line to log.- Throws:
IOException
-
log
Logs information to the log file.- Parameters:
src
- If src is a string, it will be used to describe the source. otherwise the name of the object class will be usedmessage
- the line to log.- Throws:
IOException
-
getDefaultLog
Returns the default error log object. This can be used to safely log errors. If used where there is no permission to create files, the log is generated in memory. The log may be read by thread in the current vm.The default log is controlled by the following properties set in the Infranet.properties file
- log.file: name of the default log file; defaults to
javapcm.log
- log.level: valid values are
- 0: no logging
- 1: log errors only
- 2: log errors and warnings
- 3: log all messages (default)
- Returns:
- An ErrorLog object representing the default log ('javapcm.log')
- log.file: name of the default log file; defaults to
-
openLog
protected void openLog()
-