-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
samples: limit list log in samples #227
Conversation
@@ -35,7 +35,8 @@ public static void main(String... args) throws Exception { | |||
|
|||
try (Logging logging = options.getService()) { | |||
|
|||
String logFilter = "logName=projects/" + options.getProjectId() + "/logs/" + logName; | |||
String logFilter = "logName=projects/" + options.getProjectId() + "/logs/" + logName + | |||
" AND timestamp>=\"2020-09-01T00:00:00.000Z\""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the code to generate this timestamp string is a bit verbose, so I avoided it for this simple sample. The hard coded date should be good enough to keep the query quick enough and signal to the developer that they should include a timestamp in the query
Codecov Report
@@ Coverage Diff @@
## master #227 +/- ##
=========================================
Coverage 75.37% 75.37%
Complexity 593 593
=========================================
Files 42 42
Lines 3712 3712
Branches 259 259
=========================================
Hits 2798 2798
Misses 760 760
Partials 154 154 Continue to review full report at Codecov.
|
Updates the
logging_list_log_entries
sample to limit logs fetched by timestamp. Querying over the entire log history can take minutes.