sumnerboy12 / mqtt-gpio-monitor

Python script for sending/receiving commands to/from GPIO pins via MQTT messages
46 stars 23 forks source link

log file #17

Closed timtimsson closed 7 years ago

timtimsson commented 7 years ago

Hello, is it possible to change the default log-file target? Thanks!

sumnerboy12 commented 7 years ago

Yes, by specifying the LOGFILE system environment variable;

LOGFILE = os.getenv('LOGFILE', APPNAME + '.log')
timtimsson commented 7 years ago

Hi, if i would change the target to /var/log/mqtt-gpio-monitor - is this the right syntax: ? LOGFILE = os.getenv('/var/log/mqtt-gpio-monitor ', APPNAME + '.log') ?

sumnerboy12 commented 7 years ago

You need tp set the environment variable in your session. Google is your friend, there are plenty of tutorials about how to do this. You don't need to touch the source code. Although you can if you want of course.