|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.locomotive.server.Log
A simple logging facility. Data can be logged to a file, along with
a simple datestamp (datestamp can be turned off if desired), similiar
in form to the UNIX syslog facility.
At midnight, the previous days logfile will be closed, and a new one will
be opened. A percent symbol should be placed into the log_path
to allow the server to correctly open the new file. An example
log_path is the string "logs/loco1-%.log". The standard log
of the Loco is of this type, as is the Loco EventLog.
Loco
Field Summary | |
static int |
CRITICAL_ERROR
Critical Error- Handler severely disabled. |
static int |
DEBUG
Debug information. |
static int |
DEBUG_REALLY_VERBOSE
All debug information, including internal Locomotive state logging. |
static int |
DEBUG_VERBOSE
More Debug information, including the CGI environment for each request. |
static int |
ERROR
Error. |
static int |
FATAL_ERROR
Fatal error- Handler cannot continue. |
static int |
INFO
Useful information. |
static int |
NO_LOGGING
If you don't want to do any logging at all, set the logging level of the Log instance to this value. |
static int |
NOTICE
Important information, including the URL tokens for each request. |
static int |
WARNING
Potential Problem. |
Constructor Summary | |
Log()
Default constructor for the Log class. |
|
Log(int lev,
java.lang.String root,
java.lang.String log_path)
Create a new Log. |
Method Summary | |
void |
closeLog()
Closes this Log. |
java.lang.String |
getLogPath()
Get relative path to the log file. |
java.lang.String |
getRootPath()
Get the root path. |
boolean |
isRunning()
Check if the service is running. |
void |
log(int lev,
java.lang.String s)
logs an line to the logfile, containing the string s. |
void |
setLevel(int newlev)
Adjusts the logging level to the specified level. |
void |
setLogPath(java.lang.String logPath)
Relative path name to the log file. |
void |
setPrependDate(boolean prepend)
Call this method with a prepend value of false to turn off the automatic prepending of the date on each log output line. |
void |
setRootPath(java.lang.String rootPath)
Set the root path of that the log file will be written relative to. |
void |
startService()
Start the log service. |
void |
stopService()
Stop the service. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int NO_LOGGING
public static final int FATAL_ERROR
public static final int CRITICAL_ERROR
public static final int ERROR
public static final int WARNING
public static final int NOTICE
public static final int INFO
public static final int DEBUG
public static final int DEBUG_VERBOSE
public static final int DEBUG_REALLY_VERBOSE
Constructor Detail |
public Log(int lev, java.lang.String root, java.lang.String log_path) throws java.io.IOException
lev
- the logging level for this logroot
- the path to the server root.log_path
- the log path, relative to the server root. If this
string contains a '%' (percent), the current date will
be substituted into the filename at that location in the
path.public Log()
Method Detail |
public void startService() throws ServiceException
public void stopService() throws ServiceException
public boolean isRunning()
public void setLevel(int newlev)
newlev
- the new logging level.public void log(int lev, java.lang.String s)
lev
- the level of this log request. If higher than the
current logging level, this request will be ignoreds
- the string to be written to the logpublic void closeLog()
public void setRootPath(java.lang.String rootPath)
rootPath
- Root path for the log.public java.lang.String getRootPath()
public void setLogPath(java.lang.String logPath)
logPath
- Relative pathname of the log.If this
string contains a '%' (percent), the current date will
be substituted into the filename at that location in the
path.public java.lang.String getLogPath()
public void setPrependDate(boolean prepend)
prepend
- make this true if you want the Log object to
prepend the date to the beginning of your log output
lines, or false to turn off the datestamping.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |