My "Plex Server Logs Anywhere" Project

I always have someone tell me about issues with my server when I am not at home or able to view the logs. So I figured out a really easy way to make them securely available on my desktop and android phone.

Just in case someone else finds this useful I figured I would post my solution (which I am sure there is a better way already):

  • Setup an FTP server on PMS server and setup router to forward ports.
  • Setup a script to copy the PMS logs you want to access anywhere to the root FTP folder
  • Connect and download files to whatever devices you want

I wrote a C# app that reads the logs without locking them so PMS does not run into issues writing to a locked file. It also looks for some key words in each line (errors and critical things) and writes them to a shorter file. This happens every 30 seconds so I don’t have to wait too long to see the events in the ftp server.

My desktop app and android app connect to the FTP server download the files and load them to an arraylist. I had to use Apache.Common.FtpClient for ftping and Apache.Common.io.fileutils for a single line of code to read the files into an array on Android because I am lazy.

Added a keyword search to both apps which just loops through the arrays copying lines to a new array that match the keywords then updating the views with newly created array in real time.

The android app is the better of the two at this time because of the Apache libraries where the C# just initiates a batch file which is much more limited.

Windows App

Android App with a couple thousand lines Androids ListView has no performance issues

Real time filtering which was very easy to do

@ewmessenger - I appreciate the efforts of using one’s own skills and having fun doing it.
However, I’m a lazy IT geek. I only like re-inventing the wheel if that wheel has a flat or something wrong with it that I feel I can improve. In this instance, I’d strongly recommend PlexPy for you. Not only will it let you view and search logs, it’s primary purpose is to monitor those logs and give stats regarding what you and anyone you share with watch, how often, when, what with, in what method (transcode vs direct), and so many other stats that I can’t even remember.
If you haven’t already, check it out. It can be opened through firewall, and password protected.

Tried it and love it. This was to track down an issue in real time which PlexPy is not capable of doing. This is outside the scope of what PlexPy does or is even intended to do.

I believe the actual viewing of it’s Logs tab is real-time, at least for the “Plex Media Server” section of the Logs tab.
I could be wrong. I do know that the rest of the monitoring is only after a user has stopped playing (with exception of the notification system possibilities)
Either way, I’m not ‘dissin’ your own project and only intend to present you another choice that includes Plex server logs (and much more) in a searchable manner with less reliance on 3rd party tools/ftp servers.
Again, I’m a lazy geek. =)

No I am with you 100%. Plex Py really is awesome and even when it comes to code there is never a good reason to duplicate functionality. I needed all logs and really I should have just modified PlexPy to inude more logs and to watch for other specific lines.