Log a Single Message

If you would like to write messages to the Plex log to record events that happen, you can use this API command to write a single message to the log. The message will include the log level, message and the source of the message.

URL

GET http://{ip_address}:32400/log?level={level}&message={message}&source={source}&X-Plex-Token={plex_token}

Parameters

NameDescription
ip_addressThe IP address of the Plex Media server.
plex_tokenThe Plex user token.
levelThe log level. See Remarks below for a list of valid values.
messageThe text of the message to write to the log.
sourceA string value indicating the source of the message.

Return Status

HTTP CodeDescription
200Success - The request was successful.
400Bad request - A parameter is missing.
401Unauthorized - The Plex token provided is not valid.

Response

No response is returned by the command. The status code will indicate whether the log was written successfully.

Remarks

The log message specified using this API command will be displayed in the Plex Media Server console as well as the log file located in the data directory.

The source parameter can be any value, such as the name of the application.

Ensure the message and source parameters are properly HTML encoded to ensure the values are parsed correctly.

Log level

There are several different values of log level that can be specified for this command. The table below lists the name and value for each level.

Log levels.
NameValue
Error0
Warning1
Info2
Debug3
Verbose4

To set the log level, you would just set the level parameter equal to the value from the above table.

Examples

curl -X GET http://{ip_address}:32400/log?level={level}&message={message}&source={source}&X-Plex-Token={plex_token}
import requests
plex_url = http://{ip_address}:32400/log?level={level}&message={message}&source={source}&X-Plex-Token={plex_token}
response = requests.get(plex_url)
print(response.text)
$response = Invoke-RestMethod 'http://{ip_address}:32400/log?level={level}&message={message}&source={source}&X-Plex-Token={plex_token}' -Method 'GET'
Write-Output $response
Subscribe
Display