This isn't an Alamofire feature but logging from the underlying
URLSession. Have you checked what this message looks like on device in release mode? It's possible that it cuts more of the sensitive information there. If it still shows the URL I don't think there's much you can do, as the system
os_log messages aren't under developer control. There's a runtime flag you can set to turn them off (
OS_ACTIVITY_MODE=disable), but it's only available in debug mode since it's a runtime flag, and it disables all
os functionality, including logging, signposts, and exception printing, so it's actually better to leave it enabled for development. I would check on device in release mode before worrying about it.
Additionally, you really shouldn't use
getTasksWithCompletionHandler when using Alamofire, as cancelling or otherwise modifying
URLSessionTasks out from under Alamofire can lead to unexpected behavior. If there's a particular use case for seeing all active tasks, feel free to file a feature request with details, or discuss it in a thread here. I did add
Session for Alamofire 5 RC1, so if that's what it's needed for, there's now a solution. In the end, those log messages will still print, at least in debug mode.