Java 8 has reached end of support
and will be
deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Java 8
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Java
8 applications will continue to run and receive traffic after their
deprecation date. We recommend that
you
migrate to the latest supported version of Java.
ApiProxy.LogRecord (Google App Engine API for Java)
Stay organized with collections
Save and categorize content based on your preferences.
- java.lang.Object
-
- com.google.apphosting.api.ApiProxy.LogRecord
-
- Enclosing class:
- ApiProxy
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.
-
-
Method Summary
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getMessage
public java.lang.String getMessage()
-
getSourceLocation
public java.lang.Throwable getSourceLocation()
-
getStackFrame
public java.lang.StackTraceElement getStackFrame()
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-06-16 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-16 UTC."],[[["\u003cp\u003e\u003ccode\u003eApiProxy.LogRecord\u003c/code\u003e represents a single log entry in apphosting, including the log level, a timestamp in microseconds, and a formatted message.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eLogRecord\u003c/code\u003e objects can be created with different constructors to include details like a \u003ccode\u003eStackTraceElement\u003c/code\u003e or a \u003ccode\u003eThrowable\u003c/code\u003e to specify the source location of the log message, or they can be partially copied from an existing \u003ccode\u003eLogRecord\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLogRecord\u003c/code\u003e class provides methods to access the log level (\u003ccode\u003egetLevel\u003c/code\u003e), timestamp (\u003ccode\u003egetTimestamp\u003c/code\u003e), message (\u003ccode\u003egetMessage\u003c/code\u003e), and source location information (\u003ccode\u003egetSourceLocation\u003c/code\u003e and \u003ccode\u003egetStackFrame\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe timestamp for a log is recorded in microseconds, starting from midnight UTC on January 1, 1970.\u003c/p\u003e\n"],["\u003cp\u003eIt is preferrable to use \u003ccode\u003eStackTraceElement\u003c/code\u003e to specify the source location of a log message, as the option to use \u003ccode\u003eThrowable\u003c/code\u003e is deprecated.\u003c/p\u003e\n"]]],[],null,["# ApiProxy.LogRecord (Google App Engine API for Java)\n\ncom.google.apphosting.api\n\nClass ApiProxy.LogRecord\n------------------------\n\n- java.lang.Object\n-\n - com.google.apphosting.api.ApiProxy.LogRecord\n\n-\n\n Enclosing class:\n : [ApiProxy](../../../../com/google/apphosting/api/ApiProxy.html \"class in com.google.apphosting.api\")\n\n *** ** * ** ***\n\n \u003cbr /\u003e\n\n ```\n public static final class ApiProxy.LogRecord\n extends java.lang.Object\n ``` \n `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.).\n\n A StackTraceElement may be attached to track the origin of the original\nlog message so it can be recorded in the log. \n-\n -\n\n ### Nested Class Summary\n\n \u003c!-- --\u003e\n\n -\n\n ### Constructor Summary\n\n \u003c!-- --\u003e\n\n -\n\n ### Method Summary\n\n -\n\n ### Methods inherited from class java.lang.Object\n\n`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait` \n-\n -\n\n ### Constructor Detail\n\n\n -\n\n #### LogRecord\n\n ```\n public LogRecord(ApiProxy.LogRecord.Level level,\n long timestamp,\n java.lang.String message)\n ```\n\n\n -\n\n #### LogRecord\n\n ```\n @Deprecated\n public LogRecord(ApiProxy.LogRecord.Level level,\n long timestamp,\n java.lang.String message,\n java.lang.Throwable sourceLocation)\n ``` \n Deprecated. Prefer the constructor that takes a StackTraceElement to identify the source location. \n Constructor for when the source location will be extracted from a Throwable.\n\n\n -\n\n #### LogRecord\n\n ```\n public LogRecord(ApiProxy.LogRecord.Level level,\n long timestamp,\n java.lang.String message,\n java.lang.StackTraceElement stackFrame)\n ``` \n Constructor for when the source location will be extracted from a StackTraceElement.\n\n Parameters:\n : `level` - the log level.\n : `timestamp` - the log timestamp, in microseconds since midnight UTC on 1 January 1970.\n : `message` - the log message.\n : `stackFrame` - indicates the class name, method name, file name, and line number to be\n used in the log record. The source location is extracted from this object provided that\n the file name is not null and the line number is at least 1. Otherwise, the logging\n infrastructure may attempt to deduce the source location by finding a stack frame in the\n call stack matching the class and method from `stackFrame`.\n\n\n -\n\n #### LogRecord\n\n ```\n public LogRecord(ApiProxy.LogRecord other,\n java.lang.String message)\n ``` \n A partial copy constructor.\n\n Parameters:\n : `other` - A `LogRecord` from which to\n copy the [`level`](../../../../com/google/apphosting/api/ApiProxy.LogRecord.html#level) and [`timestamp`](../../../../com/google/apphosting/api/ApiProxy.LogRecord.html#timestamp)\n but not the [`message`](../../../../com/google/apphosting/api/ApiProxy.LogRecord.html#message)\n : `message` -\n\n \u003c!-- --\u003e\n\n -\n\n ### Method Detail\n\n\n -\n\n #### getLevel\n\n ```\n public ApiProxy.LogRecord.Level getLevel()\n ```\n\n\n -\n\n #### getTimestamp\n\n ```\n public long getTimestamp()\n ``` \n Returns the timestamp of the log message, in microseconds since midnight UTC on 1 January 1970.\n\n\n -\n\n #### getMessage\n\n ```\n public java.lang.String getMessage()\n ```\n\n\n -\n\n #### getSourceLocation\n\n ```\n public java.lang.Throwable getSourceLocation()\n ```\n\n\n -\n\n #### getStackFrame\n\n ```\n public java.lang.StackTraceElement getStackFrame()\n ```"]]