Hi, I have a suggested enhancement regarding logging in plex. This is probably a fairly narrow request and probably totally out of scope for the majority of Plex users, but what the heck, here we go:-).
The current log produced by the media server is very hard to use as it does not contain any means for correlation between different log rows, for example understanding basic things like the relationship between the following things:
- Username
- IP-address
- Client
- Played content
- Data volumes
Here is an example of raw log to illustrate:
Apr 28, 2016 18:49:58:170 [1448] VERBOSE - Statistics: (Plex for LG (webOS)) Reporting 231 bytes for account 386670 on LAN: 0
Apr 28, 2016 18:49:58:147 [5732] VERBOSE - Comparing request from 84.55.71.247 against 192.168.1.0/255.255.255.0
Apr 28, 2016 18:49:58:147 [5732] VERBOSE - Auth: Checking permission for token xxxxxxxxxxxxxxxx in section 3 => 1
Apr 28, 2016 18:49:58:145 [5732] VERBOSE - Comparing request from xxx.xxx.xxx.xxx against 192.168.1.0/255.255.255.0
Apr 28, 2016 18:49:58:145 [5732] VERBOSE - Comparing request from xxx.xxx.xxx.xxx against 192.168.1.0/255.255.255.0
Apr 28, 2016 18:49:58:144 [5732] VERBOSE - * X-Plex-Token => xxxxxxxxxxxxxxxxxx
Apr 28, 2016 18:49:58:144 [5732] VERBOSE - * X-Plex-Device-Name => Plex for LG (webOS)
Apr 28, 2016 18:49:58:144 [5732] VERBOSE - * X-Plex-Device => LG (webOS)
Apr 28, 2016 18:49:58:144 [5732] VERBOSE - * X-Plex-Platform-Version => 537.41
Apr 28, 2016 18:49:58:144 [5732] VERBOSE - * X-Plex-Platform => Safari
Apr 28, 2016 18:49:58:144 [5732] VERBOSE - * X-Plex-Client-Identifier => 52u507qviu9
Apr 28, 2016 18:49:58:144 [5732] VERBOSE - * X-Plex-Version => 2.5.7
Apr 28, 2016 18:49:58:144 [5732] VERBOSE - * X-Plex-Product => Plex TV
Apr 28, 2016 18:49:58:144 [5732] VERBOSE - * X-Plex-No-Cache => 14618621971971187
Apr 28, 2016 18:49:58:143 [5732] VERBOSE - * duration => 5549526
Apr 28, 2016 18:49:58:143 [5732] VERBOSE - * time => 1277817
Apr 28, 2016 18:49:58:143 [5732] VERBOSE - * playQueueItemID => 17511
Apr 28, 2016 18:49:58:143 [5732] VERBOSE - * state => playing
Apr 28, 2016 18:49:58:143 [5732] VERBOSE - * key => /library/metadata/77242
By adding at least one common component to the related log rows, the ability to use the log in other tools would greatly increase, for example to build your own dashboards, etc. The only current solution seems to be the plex.py stuff that solves this using python code, but by doing the change suggested would enable other solutions.
My suggestion would be to add the related X-Plex-Token as part of the log messages, for example:
Apr 28, 2016 18:49:58:144 [5732] VERBOSE - * X-Plex-Token => xxxxxxxxxxxxxx * X-Plex-Device => LG (webOS)
Apr 28, 2016 18:49:58:144 [5732] VERBOSE - * X-Plex-Token => xxxxxxxxxxxxxx * X-Plex-Platform-Version => 537.41
Apr 28, 2016 18:49:58:144 [5732] VERBOSE - * X-Plex-Token => xxxxxxxxxxxxxx * X-Plex-Platform => Safari
Apr 28, 2016 18:49:58:144 [5732] VERBOSE - * X-Plex-Token => xxxxxxxxxxxxxx * X-Plex-Client-Identifier => 52u507qviu9
Apr 28, 2016 18:49:58:144 [5732] VERBOSE - * X-Plex-Token => xxxxxxxxxxxxxx * X-Plex-Version => 2.5.7
Apr 28, 2016 18:49:58:144 [5732] VERBOSE - * X-Plex-Token => xxxxxxxxxxxxxx * X-Plex-Product => Plex TV
Apr 28, 2016 18:49:58:144 [5732] VERBOSE - * X-Plex-Token => xxxxxxxxxxxxxx * X-Plex-No-Cache => 14618621971971187
Apr 28, 2016 18:49:58:143 [5732] VERBOSE - * X-Plex-Token => xxxxxxxxxxxxxx * duration => 5549526
Apr 28, 2016 18:49:58:143 [5732] VERBOSE - * X-Plex-Token => xxxxxxxxxxxxxx * time => 1277817
Doing this should also enhance the trouble-shooting capabilities using log data as you can pinpoint the log data related to a specific user/client.
Hope this would be a useful feature for more people than me!
Best regards
/Micke