69 */
70
71 public class LogRecord implements java.io.Serializable {
72 private static final AtomicLong globalSequenceNumber
73 = new AtomicLong(0);
74
75 /**
76 * The default value of threadID will be the current thread's
77 * thread id, for ease of correlation, unless it is greater than
78 * MIN_SEQUENTIAL_THREAD_ID, in which case we try harder to keep
79 * our promise to keep threadIDs unique by avoiding collisions due
80 * to 32-bit wraparound. Unfortunately, LogRecord.getThreadID()
81 * returns int, while Thread.getId() returns long.
82 */
83 private static final int MIN_SEQUENTIAL_THREAD_ID = Integer.MAX_VALUE / 2;
84
85 private static final AtomicInteger nextThreadId
86 = new AtomicInteger(MIN_SEQUENTIAL_THREAD_ID);
87
88 private static final ThreadLocal<Integer> threadIds
89 = new ThreadLocal<Integer>();
90
91 /**
92 * @serial Logging message level
93 */
94 private Level level;
95
96 /**
97 * @serial Sequence number
98 */
99 private long sequenceNumber;
100
101 /**
102 * @serial Class that issued logging call
103 */
104 private String sourceClassName;
105
106 /**
107 * @serial Method that issued logging call
108 */
109 private String sourceMethodName;
|
69 */
70
71 public class LogRecord implements java.io.Serializable {
72 private static final AtomicLong globalSequenceNumber
73 = new AtomicLong(0);
74
75 /**
76 * The default value of threadID will be the current thread's
77 * thread id, for ease of correlation, unless it is greater than
78 * MIN_SEQUENTIAL_THREAD_ID, in which case we try harder to keep
79 * our promise to keep threadIDs unique by avoiding collisions due
80 * to 32-bit wraparound. Unfortunately, LogRecord.getThreadID()
81 * returns int, while Thread.getId() returns long.
82 */
83 private static final int MIN_SEQUENTIAL_THREAD_ID = Integer.MAX_VALUE / 2;
84
85 private static final AtomicInteger nextThreadId
86 = new AtomicInteger(MIN_SEQUENTIAL_THREAD_ID);
87
88 private static final ThreadLocal<Integer> threadIds
89 = new ThreadLocal<>();
90
91 /**
92 * @serial Logging message level
93 */
94 private Level level;
95
96 /**
97 * @serial Sequence number
98 */
99 private long sequenceNumber;
100
101 /**
102 * @serial Class that issued logging call
103 */
104 private String sourceClassName;
105
106 /**
107 * @serial Method that issued logging call
108 */
109 private String sourceMethodName;
|