Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

feat: Add a sample snippet for use of the tailLogEntries API#628

Merged
minherz merged 9 commits intomasterfrom
minherz/tailLogEntry-sample
Sep 17, 2021
Merged

feat: Add a sample snippet for use of the tailLogEntries API#628
minherz merged 9 commits intomasterfrom
minherz/tailLogEntry-sample

Conversation

@minherz
Copy link
Copy Markdown
Contributor

@minherz minherz commented Aug 17, 2021

Implements samples for tailLogEntries API implemented in PR #627

@product-auto-label product-auto-label Bot added api: logging Issues related to the googleapis/java-logging API. samples Issues that are directly related to samples. labels Aug 17, 2021
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 17, 2021
@snippet-bot
Copy link
Copy Markdown

snippet-bot Bot commented Sep 17, 2021

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@generated-files-bot
Copy link
Copy Markdown

Warning: This pull request is touching the following templated files:

  • .github/release-trigger.yml
  • .github/sync-repo-settings.yaml
  • .github/trusted-contribution.yml
  • .github/workflows/ci.yaml
  • .kokoro/release/common.sh
  • .kokoro/release/drop.sh
  • .kokoro/release/promote.sh
  • .kokoro/release/publish_javadoc.sh
  • .kokoro/release/publish_javadoc11.sh
  • .kokoro/release/stage.sh
  • .kokoro/trampoline.sh
  • google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java
  • google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java
  • google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java
  • renovate.json
  • samples/install-without-bom/pom.xml
  • samples/snapshot/pom.xml
  • samples/snippets/pom.xml

@minherz minherz marked this pull request as ready for review September 17, 2021 10:41
@minherz minherz requested review from a team September 17, 2021 10:41
Copy link
Copy Markdown

@simonz130 simonz130 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job. Please rebase it and look into my question on thread.join

int allowedDeleteAttempts = 5;
boolean deleted = false;
while (!deleted && deleteAttempts < allowedDeleteAttempts) {
Thread.sleep(5000);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add logs so when looking at the test run logs we can see how many attempts it took to clean and whether cleanup succeeded or not.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do it later. Need review what and how it is better done, unless you are sure that a plain System.out.println() call will be good enough. I just moved the existing code into the base class. Adding this info is useful but might have few gotchas.

@minherz minherz force-pushed the minherz/tailLogEntry-sample branch from e1e4b21 to b028ae2 Compare September 17, 2021 17:58
@minherz minherz requested a review from simonz130 September 17, 2021 17:58
@minherz minherz force-pushed the minherz/tailLogEntry-sample branch from 21fd98d to e1e4b21 Compare September 17, 2021 18:12
@minherz minherz force-pushed the minherz/tailLogEntry-sample branch from e1e4b21 to a47a7ca Compare September 17, 2021 18:22
Comment on lines +155 to +156
} catch (Exception t) {
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: something weird here with indentation - worth re-aligning so it's clearer which '{' belongs to which '}'


package com.example.logging;

// [START logging_write_log_entry]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be logging_tail_log_entries

}
}
}
// [END logging_write_log_entry]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto logging_tail_log_entries

@minherz minherz merged commit 8115888 into master Sep 17, 2021
@minherz minherz deleted the minherz/tailLogEntry-sample branch September 17, 2021 18:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: logging Issues related to the googleapis/java-logging API. cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants