Privacy and Network traffic

Disabling network traffic collection

Network traffic collection can be disabled completely using MonitorNetwork launch option. See configuration for more info.

Bugsee captures network activity from the application and stores headers and in some cases body of the request and response. In order to allow you to hide user identifiable and other sensitive data from these network logs, we provide a way to register a filter and process each event before it's being recorded into Bugsee logs.

The principle is simple, for every event to be recorded, Bugsee will call your method and provide you with BugseeNetworkEvent object. It is your method's responsibility to clean up all user identifiable data from that structure and call listener.onEvent(event) to pass it back to Bugsee. listener.onEvent(event) can be called in other thread than calling thread.

!Java

Bugsee.setNetworkEventFilter(new NetworkEventFilter() {
    @Override
    public void filter(BugseeNetworkEvent event, NetworkEventListener listener) {
        String body = event.getBody();
        if (body != null) {
            // ..make changes
            event.setBody(body);
        }
        String errorDescription = event.getErrorDescription();
        if (errorDescription != null) {
            // ..make changes
            event.setErrorDescription(errorDescription);
        }
        String errorShortMessage = event.getErrorShortMessage();
        if (errorShortMessage != null) {
            // ..make changes
            event.setErrorShortMessage(errorShortMessage);
        }
        Map<String, Object> headers = event.getHeaders();
        if (headers != null) {
            // ..make changes
            event.setHeaders(headers);
        }
        String url = event.getUrl();
        if (url != null) {
            // ..make changes
            event.setUrl(url);
        }

        // Send the sanitized event back to Bugsee to record
        // Skip this in order to completely omit the event from Bugsee recording!
        listener.onEvent(event);
    }
});

!Kotlin

Bugsee.setNetworkEventFilter { event, listener ->
    val body = event.body
    if (body != null) {
        // ..make changes
        event.body = body
    }
    val errorDescription = event.errorDescription
    if (errorDescription != null) {
        // ..make changes
        event.errorDescription = errorDescription
    }
    val errorShortMessage = event.errorShortMessage
    if (errorShortMessage != null) {
        // ..make changes
        event.errorShortMessage = errorShortMessage
    }
    val headers = event.headers
    if (headers != null) {
        // ..make changes
        event.headers = headers
    }
    val url = event.url
    if (url != null) {
        // ..make changes
        event.url = url
    }

    // Send the sanitized event back to Bugsee to record
    // Skip this in order to completely omit the event from Bugsee recording!
    listener.onEvent(event)
}