Skip to content
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

Log Rewards errors by default #15500

Closed
zenparsing opened this issue Apr 26, 2021 · 6 comments · Fixed by brave/brave-core#8598
Closed

Log Rewards errors by default #15500

zenparsing opened this issue Apr 26, 2021 · 6 comments · Fixed by brave/brave-core#8598

Comments

@zenparsing
Copy link

Currently, the rewards log must be enabled using a command-line flag. When enabled, it will log at "verbose" level, which includes URL responses and other arbitrary data. In order to provide a better experience for diagnosing rewards issues:

  • We should log at the "error" level by default. Current call sites that log errors should be audited and modified so that they do not log arbitrary data at the "error" level.
  • We should create a feature flag that will enable "verbose" logging.
@diracdeltas
Copy link
Member

cc @PrivacyMatters. can we ensure that the errors don't include full URLs, PII, or sensitive info like tokens?

for the feature flag, we should include something in the description that tells users that sensitive information may be written to disk if they turn this flag on.

@PrivacyMatters
Copy link

Flags in 'Experiments' brave://flags have 3 settings: default, enabled, disabled. What does the 'Default' setting do? What is its purpose?

Will the the proposed flag be set to disabled? As per @diracdeltas what is the proposal re logging of URLs, ads viewed etc that may impact privacy if disclosed to Brave?

@kjozwiak
Copy link
Member

kjozwiak commented May 18, 2021

@brave/legacy_qa we won't be able to verify the above on Android until we get #15924 fixed and uplifted into 1.25.x.

@LaurenWags
Copy link
Member

Removing QA/Blocked, this should be available for testing in https://github.com/brave/brave-browser/releases/tag/v1.25.64

@stephendonner stephendonner added the QA/In-Progress Indicates that QA is currently in progress for that particular issue label May 19, 2021
@stephendonner
Copy link

stephendonner commented May 19, 2021

Verified PASSED using

Brave 1.25.64 Chromium: 90.0.4430.212 (Official Build) beta (x86_64)
Revision e3cd97fc771b893b7fd1879196d1215b622c2bed-refs/branch-heads/4430@{#1429}
OS macOS Version 11.3.1 (Build 20E241)

Steps:

Error logging

  1. new profile, launched Brave using --enable-logging=stderr --vmodule="*/bat-native-ledger/*"=6,"*/brave_rewards/*"=6,"*/bat-native-ads/*"=6,"*/bat-native-confirmations/*"=6,"*/brave_ads/*"=9,"*/brave_user_model/*"=6 --brave-ads-staging --brave-ads-debug --rewards=staging=true,reconcile-interval=5
  2. opened the Rewards panel and solved UGP captcha incorrectly
  3. went to brave://rewards-internals
  4. selected the "Logs" tab and click "Refresh"
  5. confirmed that an error has been logged
  6. correctly solved UGP captcha
  7. one-time tipped via laurenwags.github.io
  8. confirmed that non-error messages do not appear
example example example example example example
Screen Shot 2021-05-19 at 9 08 01 AM Screen Shot 2021-05-19 at 9 08 12 AM Screen Shot 2021-05-19 at 9 08 36 AM Screen Shot 2021-05-19 at 9 26 45 AM Screen Shot 2021-05-19 at 9 27 35 AM Screen Shot 2021-05-19 at 9 27 38 AM

Verbose logging

  1. new profile, launched Brave using --enable-logging=stderr --vmodule="*/bat-native-ledger/*"=6,"*/brave_rewards/*"=6,"*/bat-native-ads/*"=6,"*/bat-native-confirmations/*"=6,"*/brave_ads/*"=9,"*/brave_user_model/*"=6 --brave-ads-staging --brave-ads-debug --rewards=staging=true,reconcile-interval=5
  2. went to brave://flags and set Enable Brave Rewards verbose logging to Enabled
  3. relaunched Brave
  4. went to brave://rewards-internals
  5. selected the Logs tab and clicked Refresh
  6. confirmed that detailed information - matching console output - was logged
  7. additionally, downloaded the logs and confirmed it matched Logs output
example example example
Screen Shot 2021-05-19 at 9 10 10 AM Screen Shot 2021-05-19 at 9 11 20 AM Screen Shot 2021-05-19 at 9 13 36 AM

Verification passed on

Brave | 1.25.65 Chromium: 91.0.4472.57 (Official Build) (64-bit)
-- | --
Revision | e3443317fa07f1e9997e4a9c738eddfefc3c0292-refs/branch-heads/4472_54@{#6}
OS | Windows 10 OS Version 2004 (Build 19041.985)


Verified the test plan from brave/brave-core#8598

Confirmed error logs are shown in brave://rewards-internals when CAPTCHA test is incorrect
Confirmed non error logs should not appear in brave://rewards-internals when CAPTCH test is correct

Error logging

example example example example example example
image image image image image image

Verbose logging

Confirmed detailed logs is shown in brave://rewards-internals logs tab when Brave Rewards Verbose Logging flag is enabled via brave://flags

example example
image image

Verification passed on

Brave 1.25.65 Chromium: 91.0.4472.57 (Official Build) (64-bit)
Revision e3443317fa07f1e9997e4a9c738eddfefc3c0292-refs/branch-heads/4472_54@{#6}
OS Ubuntu 18.04 LTS

Verified the test plan from brave/brave-core#8598

Confirmed error logs are shown in brave://rewards-internals when CAPTCHA test is incorrect
Confirmed non error logs should not appear in brave://rewards-internals when CAPTCH test is correct

Error logging

example example example example example example
image image image image image image

Verbose logging

Confirmed detailed logs is shown in brave://rewards-internals logs tab when Brave Rewards Verbose Logging flag is enabled via brave://flags

example example
image image

@srirambv
Copy link
Contributor

srirambv commented May 25, 2021

Verification passed on OnePlus 6T with Android 10 running 1.25.66 x64 build

  • Verified only error logs are captured when flag is disabled
  • Verified full logs are captured when flag is enabled
  • Verified Clear/Refresh/Auto-Refresh/Download logs works correctly for both error logs and full logs
Error logs (Flag not set) Full Logs (Flag enabled)
image image

Verification passed on Samsung Tab A with Android 10 running 1.25.66 x64 build

  • Verified only error logs are captured when flag is disabled
  • Verified full logs are captured when flag is enabled
  • Verified Clear/Refresh/Auto-Refresh/Download logs works correctly for both error logs and full logs
Error logs (Flag not set) Full Logs (Flag enabled)
image image

Logged #16061

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment