|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.faa.flyfaa.FlyLog
Class used for writing log messages.
Field Summary | |
private static int |
ConnectionTimeout
The amount of time to wait for a connection from the cache before telling the user that the system is busy. |
(package private) static int |
DebugLevel
The debug level currently in force (from the properties file). |
static java.lang.String |
DEBUGLEVEL
Constant defining a medium level of logging (exceptions and debug statements) |
static java.lang.String |
ERRORLEVEL
Constant defining lowest level of logging (exceptions only) |
private static java.util.Properties |
FLYProps
The Properties object to hold the items in the properties file |
(package private) static boolean |
LogEnabled
The property indicating whether or not any logging should occur |
(package private) static java.lang.String |
LogFile
The path/filename to the file to be used for logging. |
private static java.io.PrintWriter |
out
PrintWriter for generating output |
static java.lang.String |
PROPERTIES
Location of the Fly-FAA properties file (also set explicitly in FlyFAAPoolServlet.init) |
static java.lang.String |
VERBOSELEVEL
Constant defining the highest level of logging (exceptions, debug statements, anything) |
Constructor Summary | |
FlyLog()
FlyLog constructor method. |
Method Summary | |
int |
getConnectionTimeout()
Gets the property indicating the amount of time (in whole seconds) to wait for a Connection from the cache. |
int |
getDebugLevel()
Gets the current debug level. |
boolean |
getLogEnabled()
Gets the flag indicating whether or not logging is enabled. |
java.lang.String |
getLogFile()
Gets the filename of the log file. |
static void |
loadLogFile(java.lang.String theFile)
Opens a possibly pre-existing, non-empty file for logging. |
static void |
loadNewLogFile(java.lang.String theFile)
Opens an empty file for logging. |
static void |
out(int lvl,
java.lang.String logfile,
java.lang.String msg)
Writes a message at a DebugLevel specified by lvl to the log file. |
static void |
out(int lvl,
java.lang.String logfile,
java.lang.Throwable e,
java.lang.String msg)
Writes a message at a DebugLevel specified by lvl with an Exception
to the log file. |
static void |
out(java.lang.String logfile,
java.lang.String msg)
Writes a DEBUGLEVEL message to the log file. |
static void |
out(java.lang.String logfile,
java.lang.Throwable e,
java.lang.String msg)
Writes a DEBUGLEVEL message with an Exception to the log file. |
static void |
outSpecial(java.lang.String logfile,
java.lang.String msg)
Writes a special message (with "[*NOTE]" at the beginning of it) to a log file. |
void |
setConnectionTimeout(int to)
Sets the property indicating the amount of time (in whole seconds) to wait for a Connection from the cache. |
void |
setDebugLevel(int level)
Sets the current debug level. |
void |
setLogEnabled(boolean flag)
Sets the flag indicating whether or not logging shall be enabled. |
void |
setLogFile(java.lang.String name)
Sets the log's filename. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final java.lang.String PROPERTIES
private static java.util.Properties FLYProps
public static final java.lang.String ERRORLEVEL
public static final java.lang.String DEBUGLEVEL
public static final java.lang.String VERBOSELEVEL
static java.lang.String LogFile
static boolean LogEnabled
static int DebugLevel
private static int ConnectionTimeout
private static java.io.PrintWriter out
Constructor Detail |
public FlyLog() throws javax.servlet.ServletException
javax.servlet.ServletException
- if the properties file cannot be found or is unreadable.Method Detail |
public java.lang.String getLogFile()
String
containing the logfile's filenamepublic void setLogFile(java.lang.String name)
name
- String containing the path/filename for this log file.public boolean getLogEnabled()
true
if logging is enabled, otherwise false
public void setLogEnabled(boolean flag)
flag
- boolean (true
if logging shall be enabled, otherwise
false
)public int getDebugLevel()
int
- current debugLevelpublic void setDebugLevel(int level)
level
- int representing the current debug level to be used.getDebugLevel()
public int getConnectionTimeout()
true
if logging is enabled, otherwise false
public void setConnectionTimeout(int to)
to
- int containing the number of seconds to wait for a Connectionpublic static void loadNewLogFile(java.lang.String theFile)
theFile
- String containing the server path/filename to the new log filepublic static void loadLogFile(java.lang.String theFile)
theFile
- String containing the server path/filename to the log filepublic static void out(java.lang.String logfile, java.lang.String msg)
msg
if the debugLevel is DEBUGLEVEL, that is, if all log messages are
supposed to be printed.
logfile
- String containing the server path/filename to the log filemsg
- String containing the log message to be printedpublic static void out(int lvl, java.lang.String logfile, java.lang.String msg)
lvl
to the log file.
The message is prefixed with a custom Date/Timestamp of a form similar to
'9/30/02 20:26:03.389:' followed by either '[WORDY]', '[DEBUG]' or '[ERROR]' depending
on the given lvl
. The message is only written if the 'enableLog' flag
from the properties file is set and the 'DebugLevel' property from the properties file
is greater than or equal to the given lvl
.
lvl
- int representing the DebugLevel of this log message.
If the DebugLevel property is at least this value, the message will be printed.logfile
- String containing the server path/filename to the log filemsg
- String containing the log message to be printedpublic static void out(java.lang.String logfile, java.lang.Throwable e, java.lang.String msg)
msg
if the DebugLevel is DEBUGLEVEL, that is, if all log messages are
supposed to be printed.
logfile
- String containing the server path/filename to the log filee
- Throwable object (usually an Exception)msg
- String containing the log message to be printedpublic static void out(int lvl, java.lang.String logfile, java.lang.Throwable e, java.lang.String msg)
lvl
with an Exception
to the log file. The message is prefixed with a medium format Date/Timestamp of a
form similar to '4/23/02 8:26:03 PM:'. The message is only written if the 'enableLog'
flag from the properties file is set and the 'DebugLevel' property from the properties
file is greater than or equal to the given lvl
.
lvl
- int representing the DebugLevel of this log message.logfile
- String containing the server path/filename to the log filee
- Throwable object (usually an Exception)msg
- String containing the log message to be printedpublic static void outSpecial(java.lang.String logfile, java.lang.String msg)
logfile
- String containing the server path/filename to the log filemsg
- String containing the log message to be printed
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |