Skip to content

Instantly share code, notes, and snippets.

@denisdemaisbr
Last active March 17, 2023 19:32
Show Gist options
  • Save denisdemaisbr/9ea4ae163240e9ea61e6a73a273bc301 to your computer and use it in GitHub Desktop.
Save denisdemaisbr/9ea4ae163240e9ea61e6a73a273bc301 to your computer and use it in GitHub Desktop.
sample usage of syslog using syslog4j tested with java 1.8 (openjdk version "1.8.0_362")
#!/bin/sh
#
# download package from http://syslog4j.org/
# check also https://manpages.ubuntu.com/manpages/xenial/man1/logger.1.html
#
java -cp syslog4j-0.9.46-bin.jar \
org.productivity.java.syslog4j.server.SyslogServerMain \
-h 127.0.0.1 \
-p 9999 \
udp \
"hello world"
exit 0
#!/bin/sh
#
# free firewall port udp/9999 =)
# download package from http://syslog4j.org/
#
java -cp syslog4j-0.9.46-bin.jar \
org.productivity.java.syslog4j.server.SyslogServerMain \
-h 0.0.0.0 \
-p 9999 \
-t 5000 \
syslog.txt tcp
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment