Package org.apache.juli
Class OneLineFormatter
- java.lang.Object
-
- java.util.logging.Formatter
-
- org.apache.juli.OneLineFormatter
-
public class OneLineFormatter extends Formatter
Provides same information as default log format but on a single line to make it easier to grep the logs. The only exception is stacktraces which are always preceded by whitespace to make it simple to skip them.
-
-
Constructor Summary
Constructors Constructor Description OneLineFormatter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddTimestamp(StringBuilder buf, long timestamp)Stringformat(LogRecord record)StringgetTimeFormat()Obtain the format currently being used for time stamps in log messages.voidsetTimeFormat(String timeFormat)Specify the time format to use for time stamps in log messages.-
Methods inherited from class java.util.logging.Formatter
formatMessage, getHead, getTail
-
-
-
-
Method Detail
-
setTimeFormat
public void setTimeFormat(String timeFormat)
Specify the time format to use for time stamps in log messages.- Parameters:
timeFormat- The format to use using theSimpleDateFormatsyntax
-
getTimeFormat
public String getTimeFormat()
Obtain the format currently being used for time stamps in log messages.- Returns:
- The current format in
SimpleDateFormatsyntax
-
addTimestamp
protected void addTimestamp(StringBuilder buf, long timestamp)
-
-