Welcome to the documentation for AlamofireNetworkActivityLogger, a logging interceptor for Alamofire created by the community. This library provides a convenient way to log network activity, including request and response details, while using Alamofire in your iOS projects.


  • Logs the request URL, method, headers, and body
  • Logs the response status code, headers, and body
  • Supports multiple log levels: verbose, debug, info, warning, and error
  • Can be easily integrated with existing Alamofire requests


  • iOS 10.0+
  • Swift 5+
  • Alamofire 5+


To install AlamofireNetworkActivityLogger, you have multiple options:

  • CocoaPods: Add pod 'AlamofireNetworkActivityLogger' to your Podfile and run pod install.
  • Swift Package Manager: Add .package(url: "", from: "5.0.0") to your Package.swift file or use the Xcode interface to add the package dependency.
  • Manual: Download the latest release from the GitHub repository and manually integrate it into your project.


To start logging network activity, follow these steps:

Step 1: Import the library

Add the following import statement to the file where you want to use AlamofireNetworkActivityLogger:

import AlamofireNetworkActivityLogger

Step 2: Enable logging

Add the following code snippet to enable network activity logging:


This will log all network activity with the default log level (verbose).


AlamofireNetworkActivityLogger provides several customization options to suit your needs:

Log levels

You can set the desired log level to control the verbosity of the logs. The available log levels are:

  • .verbose: Logs all information (default)
  • .debug: Logs requests and responses, excluding headers and bodies
  • .info: Logs requests and responses summary
  • .warning: Logs only requests that encountered errors
  • .error: Logs only failed requests

To set a different log level, use the following code:

NetworkActivityLogger.shared.level = .debug

Output destination

By default, AlamofireNetworkActivityLogger logs to the console. However, you can also redirect the logs to a custom output destination, such as a file or a logger framework. To do so, implement a custom `LogOutput` conforming object and assign it as the `logOutput` property of `NetworkActivityLogger.shared`. Refer to the provided documentation for more information on this topic.

Disabling logging

If, at any point, you want to stop logging network activity, use the following code:



Congratulations! You have successfully integrated and configured AlamofireNetworkActivityLogger in your project. Now, you can easily track and debug network activity within your Alamofire-based iOS applications.