---
title: "fetchAccessLog(completionHandler:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avplayeritem/fetchaccesslog(completionhandler:)"
---

# fetchAccessLog(completionHandler:)

Asynchronously retrieves the access log without blocking the calling thread.

## Declaration

```swift
nonisolated func fetchAccessLog(completionHandler: @escaping @Sendable (sending AVPlayerItemAccessLog?) -> Void)
```

```swift
nonisolated var accessLog: AVPlayerItemAccessLog? { get async }
```

## Parameters

- `completionHandler`: A block that is called with the access log. May be called with nil if no logging information is available.

## Discussion

Discussion An AVPlayerItemAccessLog provides methods to retrieve the network access log in a format suitable for serialization. If nil is returned then there is no logging information currently available for this AVPlayerItem. An AVPlayerItemNewAccessLogEntryNotification will be posted when new logging information becomes available. However, accessLog might already return a non-nil value even before the first notification is posted.
