ApiProxy.LogRecord (Google App Engine API for Java)


Class ApiProxy.LogRecord

  • java.lang.Object
    • com.google.apphosting.api.ApiProxy.LogRecord
  • Enclosing class:

    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.

    • Constructor Detail

      • LogRecord

        public 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.
        Constructor for when the source location will be extracted from a Throwable.
      • LogRecord

        public 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.
        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.
      • LogRecord

        public LogRecord(ApiProxy.LogRecord other,
                         java.lang.String message)
        A partial copy constructor.
        other - A LogRecord from which to copy the level and timestamp but not the message
        message -
    • Method Detail

      • getTimestamp

        public long getTimestamp()
        Returns the timestamp of the log message, in microseconds since midnight UTC on 1 January 1970.
      • getMessage

        public java.lang.String getMessage()
      • getSourceLocation

        public java.lang.Throwable getSourceLocation()
      • getStackFrame

        public java.lang.StackTraceElement getStackFrame()

Send feedback about...

App Engine standard environment for Java