public static final class ApiProxy.LogRecord
extends java.lang.Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
ApiProxy.LogRecord.Level |
Constructor and Description |
---|
LogRecord(ApiProxy.LogRecord.Level level,
long timestamp,
java.lang.String message) |
LogRecord(ApiProxy.LogRecord.Level level,
long timestamp,
java.lang.String message,
java.lang.StackTraceElement stackFrame)
Constructor for when the source location will be extracted from a StackTraceElement.
|
LogRecord(ApiProxy.LogRecord.Level level,
long timestamp,
java.lang.String message,
java.lang.Throwable sourceLocation)
Deprecated.
Prefer the constructor that takes a StackTraceElement to identify the source location.
|
LogRecord(ApiProxy.LogRecord other,
java.lang.String message)
A partial copy constructor.
|
Modifier and Type | Method and Description |
---|---|
ApiProxy.LogRecord.Level |
getLevel() |
java.lang.String |
getMessage() |
java.lang.Throwable |
getSourceLocation() |
java.lang.StackTraceElement |
getStackFrame() |
long |
getTimestamp()
Returns the timestamp of the log message, in microseconds since midnight UTC on
1 January 1970.
|
public LogRecord(ApiProxy.LogRecord.Level level, long timestamp, java.lang.String message)
@Deprecated public LogRecord(ApiProxy.LogRecord.Level level, long timestamp, java.lang.String message, java.lang.Throwable sourceLocation)
public LogRecord(ApiProxy.LogRecord.Level level, long timestamp, java.lang.String message, java.lang.StackTraceElement stackFrame)
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 from stackFrame
.public LogRecord(ApiProxy.LogRecord other, java.lang.String message)
public ApiProxy.LogRecord.Level getLevel()
public long getTimestamp()
public java.lang.String getMessage()
public java.lang.Throwable getSourceLocation()
public java.lang.StackTraceElement getStackFrame()