Skip to content

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

Closed
@root1

Description

@root1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions