What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags

View all Tags

custom sensor: python... write to logs not output




I'm working on a custom sensor written in python. Is there a way to write directly to the log file without breaking the sensor? For instance, say I make a call to a web service and return an object. I'd like to write the returned object to the logs display without affecting the rest of the script. This would greatly aid in our troubleshooting of custom sensors we support for our own customers.

custom-sensor python write-to-log-directly

Created on Apr 22, 2019 10:30:41 PM

1 Reply



Why not do the logging separately instead? All sensor output (i.e. stdout) will be written to the Sensor log once "Write Result To Disk" is enabled in the Sensor settings. The log can be found in PRTGs data directory, in "Logs (Sensors)" :)

PRTGapi | Feature Requests | WMI Issues | SNMP Issues

Kind regards,
Stephan Linke, Tech Support Team

Created on Apr 24, 2019 10:10:49 AM by  Stephan Linke [Paessler Support]

Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.