Package com.google.apphosting.api
Class ApiProxy.LogRecord
java.lang.Object
com.google.apphosting.api.ApiProxy.LogRecord
- Enclosing class:
- ApiProxy
LogRecord represents a single apphosting log entry,
including a Java-specific logging level, a timestamp in
microseconds, and a message, which is a formatted string containing the
rest of the logging information (e.g. class and line number
information, the message itself, the stack trace for any
exception associated with the log record, etc.).
A StackTraceElement may be attached to track the origin of the original log message so it can be recorded in the log.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionLogRecord(ApiProxy.LogRecord.Level level, long timestamp, String message) LogRecord(ApiProxy.LogRecord.Level level, long timestamp, String message, StackTraceElement stackFrame) Constructor for when the source location will be extracted from a StackTraceElement.LogRecord(ApiProxy.LogRecord.Level level, long timestamp, String message, Throwable sourceLocation) Deprecated.Prefer the constructor that takes a StackTraceElement to identify the source location.LogRecord(ApiProxy.LogRecord other, String message) A partial copy constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetLevel()@Nullable Throwable@Nullable StackTraceElementlongReturns the timestamp of the log message, in microseconds since midnight UTC on 1 January 1970.
-
Constructor Details
-
LogRecord
-
LogRecord
@Deprecated public LogRecord(ApiProxy.LogRecord.Level level, long timestamp, String message, Throwable sourceLocation) Deprecated.Prefer the constructor that takes a StackTraceElement to identify the source location.Constructor for when the source location will be extracted from a Throwable. -
LogRecord
public LogRecord(ApiProxy.LogRecord.Level level, long timestamp, String message, StackTraceElement stackFrame) Constructor for when the source location will be extracted from a StackTraceElement.- Parameters:
level- the log level.timestamp- the log timestamp, in microseconds since midnight UTC on 1 January 1970.message- the log message.stackFrame- indicates the class name, method name, file name, and line number to be used in the log record. The source location is extracted from this object provided that the file name is not null and the line number is at least 1. Otherwise, the logging infrastructure may attempt to deduce the source location by finding a stack frame in the call stack matching the class and method fromstackFrame.
-
LogRecord
A partial copy constructor.- Parameters:
other- ALogRecordfrom which to copy thelevelandtimestampbut not themessagemessage-
-
-
Method Details
-
getLevel
-
getTimestamp
public long getTimestamp()Returns the timestamp of the log message, in microseconds since midnight UTC on 1 January 1970. -
getMessage
-
getSourceLocation
-
getStackFrame
-