| Method from org.apache.catalina.logger.FileLogger Detail: |
public String getDirectory() {
return (directory);
}
Return the directory in which we create log files. |
public String getPrefix() {
return (prefix);
}
Return the log file prefix. |
public String getSuffix() {
return (suffix);
}
Return the log file suffix. |
public boolean getTimestamp() {
return (timestamp);
}
Return the timestamp flag. |
public void log(String msg) {
// Construct the timestamp we will use, if requested
Timestamp ts = new Timestamp(System.currentTimeMillis());
String tsString = ts.toString().substring(0, 19);
String tsDate = tsString.substring(0, 10);
// If the date has changed, switch log files
if (!date.equals(tsDate)) {
synchronized (this) {
if (!date.equals(tsDate)) {
close();
date = tsDate;
open();
}
}
}
// Log this message, timestamped if necessary
if (writer != null) {
if (timestamp) {
writer.println(tsString + " " + msg);
} else {
writer.println(msg);
}
}
}
Writes the specified message to a servlet log file, usually an event
log. The name and type of the servlet log is specific to the
servlet container. |
public void setDirectory(String directory) {
String oldDirectory = this.directory;
this.directory = directory;
support.firePropertyChange("directory", oldDirectory, this.directory);
}
Set the directory in which we create log files. |
public void setPrefix(String prefix) {
String oldPrefix = this.prefix;
this.prefix = prefix;
support.firePropertyChange("prefix", oldPrefix, this.prefix);
}
|
public void setSuffix(String suffix) {
String oldSuffix = this.suffix;
this.suffix = suffix;
support.firePropertyChange("suffix", oldSuffix, this.suffix);
}
|
public void setTimestamp(boolean timestamp) {
boolean oldTimestamp = this.timestamp;
this.timestamp = timestamp;
support.firePropertyChange("timestamp", Boolean.valueOf(oldTimestamp),
Boolean.valueOf(this.timestamp));
}
|
public void start() throws LifecycleException {
// Validate and update our current component state
if (started)
throw new LifecycleException
(sm.getString("fileLogger.alreadyStarted"));
lifecycle.fireLifecycleEvent(START_EVENT, null);
started = true;
super.start();
}
Prepare for the beginning of active use of the public methods of this
component. This method should be called after configure(),
and before any of the public methods of the component are utilized. |
public void stop() throws LifecycleException {
// Validate and update our current component state
if (!started)
throw new LifecycleException
(sm.getString("fileLogger.notStarted"));
lifecycle.fireLifecycleEvent(STOP_EVENT, null);
started = false;
close();
super.stop();
}
Gracefully terminate the active use of the public methods of this
component. This method should be the last one called on a given
instance of this component. |