# \[Feature Request\] Access Log for Plex Media Server

**URL:** https://forums.plex.tv/t/feature-request-access-log-for-plex-media-server/162398
**Category:** General Discussions
**Created:** [October 9, 2016, 9:14am UTC](https://forums.plex.tv/t/feature-request-access-log-for-plex-media-server/162398 "2016-10-09T09:14:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Parnty](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@Parnty](https://forums.plex.tv/u/Parnty)
#### Post date: [October 9, 2016, 9:14am UTC](https://forums.plex.tv/t/feature-request-access-log-for-plex-media-server/162398/1 "2016-10-09T09:14:41Z")

</div>

## Summary

Plex Media Server to log user interactions to a dedicated access log, separate from existing logs.

## Motivation

Required to fix the problem that a Mac computer running Plex Media Server may go into Sleep mode while a user is browsing Plex.

By monitoring a Plex access log, an external script would be able to determine when to keep a Mac computer awake, and when to let it sleep.

See this thread: [forums.plex.tv/discussion/102472/plex-server-should-keep-mac-awake-after-wake-on-lan](https://forums.plex.tv/discussion/102472/plex-server-should-keep-mac-awake-after-wake-on-lan "https://forums.plex.tv/discussion/102472/plex-server-should-keep-mac-awake-after-wake-on-lan")

## Versions Affected

Plex Media Server v2.8.1  
MacOS v10.11.6 (El Capitan)

## Details

1. The access log should be located at `~/Library/Logs/Plex Media Server/Plex Access.log`

2. Existing messages that are outputted, in debug logging mode, to `Plex Media Server.log` that start with `Request:` should now also be written to the access log.

3. However, messages that start with `Request: [127.0.0.1:##### (Loopback)]` should not be written to the access log. This will exclude requests initiated by processes in the Plex server itself rather than by users.

4. Access log messages should be outputted when in normal (non-debug) logging mode.

5. The access log should be rotated in the same way as the other existing log files.

* * *

## Example of access log messages

```auto
Oct 09, 2016 10:08:12.072 [0x700000323000] DEBUG - Request: [192.168.1.39:60967 (Subnet)] GET / (4 live) GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:08:12.115 [0x700000323000] DEBUG - Request: [192.168.1.39:60968 (Subnet)] GET / (5 live) GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:08:12.146 [0x700000323000] DEBUG - Request: [192.168.1.39:60967 (Subnet)] GET /library/sections/ (5 live) GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:08:40.626 [0x70000021d000] DEBUG - Request: [192.168.1.39:60995 (Subnet)] GET / (4 live) GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:08:40.735 [0x70000021d000] DEBUG - Request: [192.168.1.39:60996 (Subnet)] GET / (5 live) GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:08:40.764 [0x70000021d000] DEBUG - Request: [192.168.1.39:60995 (Subnet)] GET /library/sections/ (5 live) GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:08:41.304 [0x70000021d000] DEBUG - Request: [192.168.1.39:60996 (Subnet)] GET /library/sections/4/onDeck (5 live) Page 0-19 GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:08:41.456 [0x700000187000] DEBUG - Request: [192.168.1.39:60995 (Subnet)] GET /library/sections/4/recentlyAdded (5 live) Page 0-19 GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:08:41.815 [0x700000187000] DEBUG - Request: [192.168.1.39:60996 (Subnet)] GET /photo/:/transcode?width=181&height=181&url=http%3A%2F%2F127.0.0.1%3A32400%2Flibrary%2Fmetadata%2F2726%2Fthumb%2F1474742739&upscale=1&format=jpg (5 live) GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:08:42.099 [0x7000005b2000] DEBUG - Request: [192.168.1.39:60998 (Subnet)] GET /photo/:/transcode?width=181&height=181&url=http%3A%2F%2F127.0.0.1%3A32400%2Flibrary%2Fmetadata%2F1651%2Fthumb%2F1430166813&upscale=1&format=jpg (9 live) GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:08:42.408 [0x700000323000] DEBUG - Request: [192.168.1.39:61000 (Subnet)] HEAD /photo/:/transcode?width=1280&height=720&url=http%3A%2F%2F127.0.0.1%3A32400%2Flibrary%2Fmetadata%2F2726%2Fart%2F1474742739&upscale=1 (9 live) GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:08:42.416 [0x70000073b000] DEBUG - Request: [192.168.1.39:60999 (Subnet)] GET /photo/:/transcode?width=1280&height=720&url=http%3A%2F%2F127.0.0.1%3A32400%2Flibrary%2Fmetadata%2F2726%2Fart%2F1474742739&upscale=1 (9 live) GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:09:51.437 [0x70000021d000] DEBUG - Request: [192.168.1.39:32770 (Subnet)] GET /library/sections/4 (5 live) GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:09:51.637 [0x70000021d000] DEBUG - Request: [192.168.1.39:32769 (Subnet)] GET /library/sections/4/filters?type=2 (5 live) GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:09:51.714 [0x70000021d000] DEBUG - Request: [192.168.1.39:32770 (Subnet)] GET /library/sections/4/sorts?type=2 (5 live) GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:09:51.793 [0x70000021d000] DEBUG - Request: [192.168.1.39:32769 (Subnet)] GET /library/sections/4/firstCharacter?type=2&sort=titleSort%3Aasc (5 live) GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:09:51.898 [0x70000021d000] DEBUG - Request: [192.168.1.39:32771 (Subnet)] GET /library/sections/4/all?type=2&sort=titleSort%3Aasc (6 live) Page 0-23 GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:09:52.084 [0x70000021d000] DEBUG - Request: [192.168.1.39:32770 (Subnet)] GET /library/sections/4/firstCharacter?type=2&sort=titleSort%3Aasc (6 live) GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:10:57.687 [0x700000323000] DEBUG - Request: [192.168.1.39:32776 (Subnet)] GET /library/sections/4/onDeck (4 live) Page 0-19 GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:10:57.780 [0x70000021d000] DEBUG - Request: [192.168.1.39:32777 (Subnet)] GET /library/sections/4/recentlyAdded (5 live) Page 0-19 GZIP Signed-in Token (Parnty)
Oct 09, 2016 10:11:33.039 [0x700000187000] DEBUG - Request: [192.168.1.39:32786 (Subnet)] GET /playlists (4 live) Page 0-19 GZIP Signed-in Token (Parnty)

```

## Examples of excluded messages

```auto
Oct 08, 2016 07:22:41.967 [0x700000ad0000] DEBUG - Request: [127.0.0.1:59918 (Loopback)] GET /library/sections (3 live) GZIP Signed-in Token (Parnty)
Oct 08, 2016 07:22:41.996 [0x700000b53000] DEBUG - Request: [127.0.0.1:59919 (Loopback)] GET /channels/all (3 live) GZIP Signed-in Token (Parnty)
Oct 08, 2016 07:22:42.021 [0x700000ad0000] DEBUG - Request: [127.0.0.1:59921 (Loopback)] GET /servers (2 live) GZIP Signed-in Token (Parnty)

```

---

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)
#### Post date: [January 7, 2020, 10:02pm UTC](https://forums.plex.tv/t/feature-request-access-log-for-plex-media-server/162398/2 "2020-01-07T22:02:53Z")

</div>


