Konrad Biernacki ([email protected])
A lightweight utility for capturing network traffic in Android apps.
![]() |
![]() |
- Record and inspect HTTP/HTTPS requests and response
- Identify failed or unexpected responses
- Share and export individual requests via the clipboard
- Additionally export as a
cURLcommand
- Additionally export as a
- Comes with batteries-included for:
- Ktor
- OkHttp
A sample Android app is included under ./sample.
The latest release is available on Maven Central.
dependencies {
implementation 'dev.kgbier.util:networklogger:1.1'
}Snapshot builds are available.
- Depend on the
okhttpflavour of this library:
dependencies {
implementation 'dev.kgbier.util:networklogger-okhttp:1.1'
}- Add the
NetworkLoggerOkHttpInterceptorto your OkHttp client:
OkHttpClient.Builder()
.addInterceptor(NetworkLoggerOkHttpInterceptor(applicationContext))
.build()- View logs by starting the included activity:
startActivity(makeNetworkLoggerActivityIntent(context))- Depend on the
ktorflavour of this library:
dependencies {
implementation 'dev.kgbier.util:networklogger-ktor:1.1'
}- Add the
NetworkLoggerKtorPluginInstallerto your Ktor client:
HttpClient(CIO) {
install(NetworkLoggerKtorPluginInstaller(applicationContext))
}- View logs by starting the included activity:
startActivity(makeNetworkLoggerActivityIntent(context))- Get a handle on the logging repository:
val logginRepo = NetworkLoggerRepository(applicationContext)- Log a request when it is about to be sent:
loggingRepo.logRequest(
transactionId = requestTransactionId,
url = request.url.toString(),
method = request.method,
headers = request.headers.toList(),
body = bodyBuffer.readString(Charsets.UTF_8),
timestamp = System.currentTimeMillis(),
)- Log a response when it is received:
loggingRepo.logResponse(
transactionId = requestTransactionId,
statusCode = response.code,
headers = response.headers.toList(),
body = bodyBuffer.readString(Charsets.UTF_8),
timestamp = System.currentTimeMillis(),
)- View logs by starting the included activity:
startActivity(makeNetworkLoggerActivityIntent(context))
