How to enable Plex to export syslog?

How to enable Plex to export syslog? …as title

i follow this however seems not working.
https://support.plex.tv/hc/en-us/articles/201105343-Advanced-Hidden-Server-Settings

I have added the variable to start-stop-status script as below, however there is still no log message in syslog.log in var/log.


admin@MovieHACluster:/var/packages/Plex Media Server/scripts$ cat start-stop-status
#!/bin/sh

PLEX_MEDIA_SERVER_USE_SYSLOG=true
PLEX_DIR="/var/packages/Plex Media Server/target"
PLEX_LIBRARY_PATH=cat "$PLEX_DIR/plex_library_path"
PID_FILE="$PLEX_LIBRARY_PATH/Plex Media Server/plexmediaserver.pid"
ARCH=$(uname -m)

if echo $ARCH | grep -q i.86; then
PROCS=6
else
PROCS=6


If I may augment here, given the amount of information PMS outputs and the small size Synology allocates for the root partition, have you addressed how you’re going to keep the system log from filling the file system?

Hi ChuckPA,

Sorry…what do you mean?

when you write PMS logs to syslog, this places them in /var/log which is, by default, on the root file system of the Syno. The typical root filesystem for DSM is 2GB

admin@moesern:~$ df -m /
Filesystem     1M-blocks  Used Available Use% Mounted on
/dev/md0            2330   870      1345  40% /
admin@moesern:~$ 

Hi ChuckPA,

Oh…actually i want to log all event appears in plex web gui’s status–> alert. Now what i can only can view the latest 50 pages of event with no search and i do want to export the alert to another file like.txt for my future searching. Also i need to always open the webGUI for plex in order to receive alerts.

Is it able to address this?

I’ve got some good news and some not-so-good news.

Unless I’m holding it completely wrong, DSM sends event logs just fine. PMS doesn’t send any whether exported as ‘TRUE’, ‘true’, any positive integer or simply exported to the environment.

I’ve found in the code where it’s checking for the environment variable (not shell variable). I’ve written some test code to verify what I think it should be doing. My code works as expected.

I will need to dig deeper into this and talk with engineering.

Thanks!!. looking forward to seeing your update!

Here’s where we stand.

  1. exporting PLEX_MEDIA_SERVER_USE_SYSLOG in the start routine does suppress writing to the log files.
  2. Messages are not appearing in the Synology or remote syslog server
  3. Conclusion: broken and needs further review
  4. Open issue: If PMS logs sent to a syslog server then they will not be available to submit here for support resulting in an unsupportable configuration.

Supplementary data. The ‘Alerts’ you see are not subject to syslog. They appear regardless

Chuck,

I see this is a little old but I wanted resurrect this and see if anything has changed. Ideally I would like to archive the PMS log to my syslog server, so I can review messages when I want to. Is there any ability to do this, or does this come from DSM? If DSM then is there a way to isolate only those PMS alert and error msgs?

Thanks,
Steve

First, the biggest problem with sending them to SYSLOG is that you also send them to the Synology’s SYSLOG and fill the root partition of DSM (which isn’t /volume1) within a few hours on an active system or even minutes when VERBOSE logging is enabled. (Plex uses a FIFO log buffer where SYSLOG is always appending)

Observe here, where with only PMS installed (on volume1), the root filesystem is at 45% full .

Filesystem     1M-blocks     Used Available Use% Mounted on
/dev/md0            2330      984      1231  45% /
none                3983        0      3983   0% /dev
/tmp                3987        1      3986   1% /tmp
/run                3987        4      3984   1% /run
/dev/shm            3987        1      3987   1% /dev/shm
none                   1        0         1   0% /sys/fs/cgroup
cgmfs                  1        0         1   0% /run/cgmanager/fs
/dev/md2        39870210 35458407   4411688  89% /volume1
admin@moesern:~$

Since they have a very closed package environment, every time you updated PMS, you would have to again modify the package start-stop control module.

This is easily doable and practical on a desktop / server Linux machine. It’s not practical on the DiskStation series consumer/home products. Synology presents a mac-like “easy click and go” environment which means sacrificing the ability to customize.

Ahhh ok…so if I moved the syslog server to another device then this becomes doable. I might go down that route. I have a 2TB external USB drive that I could connect to another system and use it as a syslog server. I have implemented a full feature firewall/IDS-IPS and want to save those alerts off via syslog, and then be able to review them separately.

It’s still a nogo.

What would happen is all of Plex’s logs, even the agents, would be output as a monolithic stream. Nothing is written to the internal logs. All the individual files would be merged and interwoven.

We’ve tried to use them and discovered we can’t. It takes hours to sort out a user’s system traffic from Plex traffic and then each of the agents’ output into agent files. It’s not something we can automate.

it still stays in DSM unless you’ve cracked out to get DSM to redirect to a server instead of writing to local disk.

The ‘rub’, should you do this, is none of your logs will be usable by us.
In a sentence; You’re on your own with support. You would need be able to re-enable Plex’s logs, recreate the fault, then put it back.

This sucks…in this day and age of logs being our primary way of debugging issues we should have the ability to have our PMS output logs to another server. They should be able to keep them locally and then send them to another server. This is the 21st century…

This is Linux. It’s how it is. Syslog is Syslog.

The new way of doing everything is the journal.
You can do a whole lot more with it than plain old syslog but PMS is distro agnostic.

Have you considered installing rsyslogd and having it take over?
This would leave your entire Plex server atomic and untouched. Everything written to the local syslog would be sent to the remote server you configure.