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

Unable to View Raw HTTP Logs in Logcat for Login Issue #2287

Open
root1 opened this issue Jan 16, 2025 · 0 comments
Open

Unable to View Raw HTTP Logs in Logcat for Login Issue #2287

root1 opened this issue Jan 16, 2025 · 0 comments

Comments

@root1
Copy link

root1 commented Jan 16, 2025

Description:
I am encountering an issue while trying to run the android-client application from this repository. The application fails during the login process. Based on the logcat output, the login request seems to be successful, but the response JSON parsing might be failing. To debug this issue, I tried enabling full body logging to view the raw HTTP requests and responses. However, despite setting up the HttpLoggingInterceptor to log the body (as shown in the attached image), I am not able to see the logs for requests and responses in logcat.

Steps to Reproduce:

Clone the repository: https://github.com/openMF/android-client.

Build and run the application on an emulator or physical device.

Attempt to log in with the provided credentials.

Observe the logcat output during the login process.

Expected Behavior:
Logcat should display the raw HTTP request and response bodies due to the HttpLoggingInterceptor set to Level.BODY.

Actual Behavior:
No raw HTTP request or response logs are visible in logcat, making it difficult to debug the issue with JSON parsing.

Additional Details:

The attached logcat screenshot shows the stack trace of a NullPointerException occurring during the login process.

Another screenshot confirms that HttpLoggingInterceptor is configured with Level.BODY and attached to the OkHttpClient builder.

Attachments:

Logcat stack trace showing the error.

Code snippet of HttpLoggingInterceptor configuration.

Request for Help:

Could anyone suggest why the raw HTTP logs are not appearing in logcat despite enabling HttpLoggingInterceptor?

Are there any additional configurations or settings required to ensure logs are properly displayed?

Any tips for debugging the JSON parsing issue?

Thank you for your assistance!

Screenshots:
Screenshot from 2025-01-16 08-24-10
Screenshot from 2025-01-16 08-20-52

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

No branches or pull requests

1 participant