Logging Programming Python

Python – code to emit syslog message.

Reading Time: < 1 minute

This article will discuss a quick and dirty method used for creating syslog events. This is handy for testing syslog logging. It should be noted that this is just one method. There are a number of tools for this including Windows tools for testing.

I got cheap and put the code on github. I have credited the original author. The code is configured to use the “LAB” Syslog server configured in a separate post.

git clone https://github.com/tlh45342/syslogger.git
root@ubuntu2:~/syslogger# python syslogger.py
root@syslog:/var/log# tail --lines 1 syslog
Apr  4 18:38:01 Hi

Just a reminder that a log message can be easily created with “logger”

logger -T -P 514 -n "B@TTERup"

Related posts

git – cli – part 1

Tom Hamilton

Splunk and SYSLOG

Tom Hamilton

QRadar configuring a syslog source.