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

feat: status-go API logging option #16808

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

igor-sirotin
Copy link
Contributor

@igor-sirotin igor-sirotin commented Nov 23, 2024

Closes #16414

Requires:

What does the PR do

  1. Added ability to enable status-go API logging. Run with --api-logging or env var STATUS_RUNTIME_API_LOGGING=1.
    The log will appear in <account>/data/api.log file.

  2. Also added proper initialization of logging in status-go.
    Before this PR logs would appear in geth.log file only after logging into account, and before logging it it was in in console.
    Now all logs go into the file right from the start.

Affected areas

Logging, initialize application

Risk

Described potential risks and worst case scenarios.

Tick one:

  • Low risk: 2 devs MUST perform testing as specified above and attach their results as comments to this PR before merging.
  • High risk: QA team MUST perform additional testing in the specified affected areas before merging.

@igor-sirotin igor-sirotin requested a review from a team as a code owner November 23, 2024 17:48
@igor-sirotin igor-sirotin requested review from richard-ramos, a team, antdanchenko, jrainville and anastasiyaig and removed request for a team and richard-ramos November 23, 2024 17:48
@igor-sirotin igor-sirotin changed the title feat: statusgo api log feat: status-go API logging option Nov 23, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Nov 23, 2024

Jenkins Builds

Click to see older builds (15)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ ba08230 #1 2024-11-23 17:56:38 ~7 min macos/aarch64 🍎dmg
✔️ ba08230 #1 2024-11-23 17:57:16 ~8 min tests/nim 📄log
ba08230 #1 2024-11-23 18:01:36 ~12 min tests/ui 📄log
✔️ ba08230 #1 2024-11-23 18:04:02 ~15 min macos/x86_64 🍎dmg
✔️ ba08230 #1 2024-11-23 18:04:52 ~15 min linux-nix/x86_64 📦tgz
✔️ ba08230 #1 2024-11-23 18:12:35 ~23 min linux/x86_64 📦tgz
✔️ ba08230 #1 2024-11-23 18:17:15 ~28 min windows/x86_64 💿exe
✔️ ba08230 #2 2024-11-25 07:24:34 ~12 min tests/ui 📄log
✔️ bb046a8 #2 2024-11-25 09:03:48 ~4 min macos/aarch64 🍎dmg
✔️ bb046a8 #2 2024-11-25 09:07:45 ~8 min tests/nim 📄log
bb046a8 #3 2024-11-25 09:11:10 ~12 min tests/ui 📄log
✔️ bb046a8 #2 2024-11-25 09:12:38 ~13 min macos/x86_64 🍎dmg
✔️ bb046a8 #2 2024-11-25 09:21:24 ~22 min linux-nix/x86_64 📦tgz
✔️ bb046a8 #2 2024-11-25 09:21:47 ~22 min linux/x86_64 📦tgz
✔️ bb046a8 #2 2024-11-25 09:26:18 ~27 min windows/x86_64 💿exe
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ a9cb321 #3 2024-11-25 10:10:32 ~4 min macos/aarch64 🍎dmg
✔️ a9cb321 #3 2024-11-25 10:13:56 ~8 min tests/nim 📄log
✔️ a9cb321 #3 2024-11-25 10:18:18 ~12 min macos/x86_64 🍎dmg
✔️ a9cb321 #4 2024-11-25 10:18:35 ~12 min tests/ui 📄log
✔️ a9cb321 #3 2024-11-25 10:25:24 ~19 min linux-nix/x86_64 📦tgz
✔️ a9cb321 #3 2024-11-25 10:27:13 ~21 min linux/x86_64 📦tgz
✔️ a9cb321 #3 2024-11-25 10:31:30 ~25 min windows/x86_64 💿exe
✔️ 01191de #4 2024-11-25 10:40:40 ~4 min macos/aarch64 🍎dmg
✔️ 01191de #4 2024-11-25 10:43:40 ~7 min tests/nim 📄log
✔️ 01191de #4 2024-11-25 10:48:14 ~12 min macos/x86_64 🍎dmg
✔️ 01191de #5 2024-11-25 10:48:32 ~12 min tests/ui 📄log
✔️ 01191de #4 2024-11-25 10:56:30 ~20 min linux-nix/x86_64 📦tgz
✔️ 01191de #4 2024-11-25 10:57:46 ~21 min linux/x86_64 📦tgz
✔️ 01191de #4 2024-11-25 11:03:49 ~27 min windows/x86_64 💿exe

@anastasiyaig
Copy link
Contributor

hey @igor-sirotin , thanks for that PR

sadly i could not see any api.log file anywhere, neither for dev build nor for local build. I run the app for the packaged build like this:

./nim_status_client --datadir=~/data/logs --LOG_LEVEL=DEBUG --api-logging

I also added mentioned env var, but not sure, shall it have any value? tried with True and without any value (as mentioned in PR) - no result.

Also I tried with local build by using this command:

make -j10 clean && make -j10 update && cd vendor/status-go && make -j10 statusgo-shared-library && cd ../../ && make run ARGS="--api-logging"
Screenshot 2024-11-25 at 10 54 28 AM

@igor-sirotin
Copy link
Contributor Author

@anastasiyaig indeed, sorry for that. Looks like I missed to bump status-go in my commit 🤦
Updated now, works for me with both --api-logging and STATUS_RUNTIME_API_LOGGING=1. Env var should be set to 1 or true.

@anastasiyaig
Copy link
Contributor

alright it works to me now, thanks @igor-sirotin
if thats possible, can we get rid of the \ in the request body?

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

Successfully merging this pull request may close these issues.

Implement logging of go request and response
4 participants