|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.appengine.api.log.LogQuery
public final class LogQuery
Allows users to customize the behavior of LogService.fetch(LogQuery).
startTime is the earliest request completion or last-update time
that results should be fetched for, in seconds since the Unix epoch. If
null then no requests will be excluded for ending too long ago.
endTime is the latest request completion or last-update time that
results should be fetched for, in seconds since the Unix epoch. If
null then no requests will be excluded for ending too recently.
offset is a cursor into the log stream retrieved from a previously
emitted RequestLogs.getOffset(). This iterator will begin returning
logs immediately after the record from which the offset came. If
null, the query will begin at startTime.
minLogLevel is a LogService.LogLevel which serves as a
filter on the requests returned. Requests with no application logs at or
above the specified level will be omitted. Works even if
includeAppLogs is not True.
includeIncomplete selects whether requests that have started but not
yet finished should be included in the query. Defaults to False.
includeAppLogs specifies whether or not to include application logs
in the query results. Defaults to False.
majorVersionIds specifies which the version(s) of the application
for which logs should be retrieved. If null, logs for the version
making the request will be returned.
batchSize specifies the internal batching strategy of the returned
Iterable. Has no impact on the result of the query.
Notes on usage:
The recommended way to instantiate a LogQuery object is to
statically import LogQuery.Builder.* and invoke a static
creation method followed by an instance mutator (if needed):
import static com.google.appengine.api.log.LogQuery.Builder.*;
...
// All requests, including application logs.
iter = logService.fetch(withIncludeAppLogs(true));
// All requests ending in the past day (or still running) with an info log or higher.
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH, -1);
iter = logService.fetch(withEndTimeMillis(cal.time())
.includeIncomplete(true).minimumLogLevel(LogService.INFO));
| Nested Class Summary | |
|---|---|
static class |
LogQuery.Builder
Contains static creation methods for FetchOptions. |
| Constructor Summary | |
|---|---|
LogQuery()
|
|
| Method Summary | |
|---|---|
LogQuery |
batchSize(int batchSize)
Sets the batch size. |
LogQuery |
endTimeMillis(long endTimeMillis)
Sets the end time to a value in milliseconds. |
LogQuery |
endTimeUsec(long endTimeUsec)
Sets the end time to a value in microseconds. |
java.lang.Integer |
getBatchSize()
|
java.lang.Long |
getEndTimeMillis()
|
java.lang.Long |
getEndTimeUsec()
|
java.lang.Boolean |
getIncludeAppLogs()
|
java.lang.Boolean |
getIncludeIncomplete()
|
java.util.List<java.lang.String> |
getMajorVersionIds()
|
LogService.LogLevel |
getMinLogLevel()
|
java.lang.String |
getOffset()
|
java.lang.Long |
getStartTimeMillis()
|
java.lang.Long |
getStartTimeUsec()
|
LogQuery |
includeAppLogs(boolean includeAppLogs)
Sets include application logs. |
LogQuery |
includeIncomplete(boolean includeIncomplete)
Sets include incomplete. |
LogQuery |
majorVersionIds(java.util.List<java.lang.String> versionIds)
Sets the major version identifiers to query. |
LogQuery |
minLogLevel(LogService.LogLevel minLogLevel)
Sets the minimum log level. |
LogQuery |
offset(java.lang.String offset)
Sets the offset. |
LogQuery |
startTimeMillis(long startTimeMillis)
Sets the start time to a value in milliseconds. |
LogQuery |
startTimeUsec(long startTimeUsec)
Sets the start time to a value in microseconds. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LogQuery()
| Method Detail |
|---|
public LogQuery offset(java.lang.String offset)
offset - The offset to set.
this (for chaining)public LogQuery startTimeMillis(long startTimeMillis)
startTimeMillis - The start time to set, in milliseconds.
this (for chaining)public LogQuery startTimeUsec(long startTimeUsec)
startTimeUsec - The start time to set, in microseconds.
this (for chaining)public LogQuery endTimeMillis(long endTimeMillis)
endTimeMillis - The end time to set, in milliseconds.
this (for chaining)public LogQuery endTimeUsec(long endTimeUsec)
endTimeUsec - The end time to set, in microseconds.
this (for chaining)public LogQuery batchSize(int batchSize)
batchSize - The batch size to set. Must be greater than 0.
this (for chaining)public LogQuery minLogLevel(LogService.LogLevel minLogLevel)
minLogLevel - The minimum log level to set.
this (for chaining)public LogQuery includeIncomplete(boolean includeIncomplete)
includeIncomplete - The value to set.
this (for chaining)public LogQuery includeAppLogs(boolean includeAppLogs)
includeAppLogs - The value to set.
this (for chaining)public LogQuery majorVersionIds(java.util.List<java.lang.String> versionIds)
versionIds - The major version identifier list to set.
this (for chaining)public java.lang.String getOffset()
null if none was provided.public java.lang.Integer getBatchSize()
null if none was provided.public java.lang.Long getEndTimeMillis()
null if none was provided.public java.lang.Long getEndTimeUsec()
null if none was provided.public java.lang.Boolean getIncludeAppLogs()
public java.lang.Boolean getIncludeIncomplete()
public LogService.LogLevel getMinLogLevel()
null is none was provided.public java.lang.Long getStartTimeMillis()
null is none was provided.public java.lang.Long getStartTimeUsec()
null is none was provided.public java.util.List<java.lang.String> getMajorVersionIds()
null is none were set.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||