| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static enum | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final int | globalCacheSize
The size of our global date format cache |
| private static final int | localCacheSize
The size of our thread local date format cache |
| private ThreadLocal | localDateCache
Thread local date format cache. |
| private volatile OneLineFormatter. | |
| private static final int | |
| private static volatile ThreadMXBean | |
| private static final Object | |
| private static final ThreadLocal | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| public String | format(LogRecord
the log record to be formatted. record)Implements abstract java. Format the given log record and return the formatted string. |
| private static String | |
| public String | Returns: The current format injava. syntaxObtain the format currently being used for time stamps in log messages. |
| public void | setTimeFormat(final String
The format to use using the timeFormat)java. syntaxSpecify the time format to use for time stamps in log messages. |
| DEFAULT_TIME_FORMAT | back to summary |
|---|---|
| private static final String DEFAULT_TIME_FORMAT | |
| globalCacheSize | back to summary |
|---|---|
| private static final int globalCacheSize The size of our global date format cache | |
| localCacheSize | back to summary |
|---|---|
| private static final int localCacheSize The size of our thread local date format cache | |
| localDateCache | back to summary |
|---|---|
| private ThreadLocal<DateFormatCache> localDateCache Thread local date format cache. | |
| millisHandling | back to summary |
|---|---|
| private volatile OneLineFormatter. | |
| THREAD_NAME_CACHE_SIZE | back to summary |
|---|---|
| private static final int THREAD_NAME_CACHE_SIZE | |
| threadMxBean | back to summary |
|---|---|
| private static volatile ThreadMXBean threadMxBean | |
| threadMxBeanLock | back to summary |
|---|---|
| private static final Object threadMxBeanLock | |
| threadNameCache | back to summary |
|---|---|
| private static final ThreadLocal<OneLineFormatter. | |
| UNKNOWN_THREAD_NAME | back to summary |
|---|---|
| private static final String UNKNOWN_THREAD_NAME | |
| OneLineFormatter | back to summary |
|---|---|
| public OneLineFormatter() | |
| addTimestamp | back to summary |
|---|---|
| protected void addTimestamp(StringBuilder buf, long timestamp) | |
| format | back to summary |
|---|---|
| public String format(LogRecord record) Implements abstract java. Doc from java. Format the given log record and return the formatted string.
The resulting formatted String will normally include a
localized and formatted version of the LogRecord's message field.
It is recommended to use the | |
| getThreadName | back to summary |
|---|---|
| private static String getThreadName(int logRecordThreadId) LogRecord has threadID but no thread name. LogRecord uses an int for thread ID but thread IDs are longs. If the real thread ID > (Integer.MAXVALUE / 2) LogRecord uses it's own ID in an effort to avoid clashes due to overflow. Words fail me to describe what I think of the design decision to use an int in LogRecord for a long value and the resulting mess that follows. | |
| getTimeFormat | back to summary |
|---|---|
| public String getTimeFormat() Obtain the format currently being used for time stamps in log messages.
| |
| setTimeFormat | back to summary |
|---|---|
| public void setTimeFormat(final String timeFormat) Specify the time format to use for time stamps in log messages.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | println(Object
The x)Object to be printed.Overrides java. Prints an Object and then terminates the line. |
| IndentingPrintWriter | back to summary |
|---|---|
| pack-priv IndentingPrintWriter(Writer out) | |
| println | back to summary |
|---|---|
| public void println(Object x) Overrides java. Doc from java. Prints an Object and then terminates the line. This method calls
at first String.valueOf(x) to get the printed object's string value,
then behaves as
though it invokes | |
| Modifier and Type | Field and Description |
|---|---|
| public static final OneLineFormatter. | |
| public static final OneLineFormatter. | |
| public static final OneLineFormatter. | |
| public static final OneLineFormatter. | |
| public static final OneLineFormatter. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static OneLineFormatter. | |
| public static OneLineFormatter. |
| APPEND | back to summary |
|---|---|
| public static final OneLineFormatter. | |
| NONE | back to summary |
|---|---|
| public static final OneLineFormatter. | |
| REPLACE_S | back to summary |
|---|---|
| public static final OneLineFormatter. | |
| REPLACE_SS | back to summary |
|---|---|
| public static final OneLineFormatter. | |
| REPLACE_SSS | back to summary |
|---|---|
| public static final OneLineFormatter. | |
| MillisHandling | back to summary |
|---|---|
| private MillisHandling() | |
| valueOf | back to summary |
|---|---|
| public static OneLineFormatter. | |
| values | back to summary |
|---|---|
| public static OneLineFormatter. | |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | removeEldestEntry(Map.
The least recently inserted entry in the map, or if
this is an access-ordered map, the least recently accessed
entry. This is the entry that will be removed if this
method returns eldesttrue. If the map was empty prior
to the put or putAll invocation resulting
in this invocation, this will be the entry that was just
inserted; in other words, if the map contains a single
entry, the eldest entry is also the newest.Overrides java. Returns |
| cacheSize | back to summary |
|---|---|
| private final int cacheSize | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| ThreadNameCache | back to summary |
|---|---|
| pack-priv ThreadNameCache(int cacheSize) | |
| removeEldestEntry | back to summary |
|---|---|
| protected boolean removeEldestEntry(Map. Overrides java. Doc from java. Returns Sample use: this override will allow the map to grow up to 100 entries and then delete the eldest entry each time a new entry is added, maintaining a steady state of 100 entries.
private static final int MAX_ENTRIES = 100;
protected boolean removeEldestEntry(Map.Entry eldest) {
return size() > MAX_ENTRIES;
}
This method typically does not modify the map in any way,
instead allowing the map to modify itself as directed by its
return value. It is permitted for this method to modify
the map directly, but if it does so, it must return
This implementation merely returns
| |