Skip to main content
NetworkingLog extends BeagleLog to provide specialized handling for network requests and responses. It automatically tracks request details, response status, and sets appropriate log levels based on HTTP status codes.
NetworkingLog is not exported from the public API. Network logging is handled automatically by the BeagleProvider component. This documentation is provided for reference to understand how network logs are structured.

Properties

Inherits all properties from BeagleLog, plus:
string
required
The full URL of the network request.
string
required
The hostname extracted from the URL (e.g., api.example.com).
NetworkingRequest
required
The request details including method, URL, headers, and body.
NetworkingResponse
Optional response details. Present when the request has completed.

Constructor

NetworkingRequest
required
The network request object containing URL, method, headers, and body.
NetworkingResponse
Optional response object. If provided, determines the log level based on status code.
string
Optional custom ID for the log entry.
Behavior:
  • Extracts host and path from the request URL
  • Sets message to {METHOD} {path} (e.g., GET /api/users)
  • If response is provided:
    • Sets level to 'error' for status >= 400 or kind === ‘error’
    • Sets level to 'warning' for status 300-399
    • Sets level to 'success' for status < 300
  • If no response, sets level to 'loading'

Methods

filter()

Overrides the base filter() method to search both message and host.
string
required
The search query to filter by.
Returns: boolean - true if the query matches the message or host (case-insensitive).

Type Definitions

NetworkingRequest

NetworkingResponse

NetworkingHeaders

How It’s Used Automatically

When you enable the Networking plugin, React Native Beagle automatically intercepts network requests and creates NetworkingLog entries:
  1. Request starts: A log is created with 'loading' level
  2. Response received: The log is updated with response data and appropriate level
  3. Error occurs: The log level becomes 'error'
You typically don’t need to create NetworkingLog instances manually.

Log Structure Examples

These examples show the structure of NetworkingLog instances as they appear in your Beagle inspector. Network logs are created automatically - you don’t create them manually.

Request in Progress (Loading)

Successful Response

Error Response

Class Definition