I am picking this back up again. I decided on a few things:
- Forward U2 aix servers' syslog to a central syslog server
- Write a syslog client in python that is specifically for applications my company has written (or modified)
The reason for not using logger directly, is I don't want to be limited to syslog's LOCAL0 to LOCAL7 for application logic. I also have a desire/need to gain access to this data.
The python logger has a namespace arg that lets you create loggers with arbitrary dot delimited names so I can log oori.ptp.optio differently than oori.ptp.reportlab.
The python logger also has multiple output handlers and just provides so much flexibility. This solution is almost in its entirety borrowed from
this solution.
There is a cgi that will display the last 300 submissions in a browser and they are forwarded on from this web app to a central syslog server.
ScreenshotIn the webpage, the critical error is flashing.
One of the last pieces to resolve is how to safely pass a string from Unibasic to the python (clogger.py) clear of any shell breaking chars. I typically strip them out, but I would love a way to escape them and keep them in the output. I know that I can use '\' to escape them, but I can always come up with a counter example of another way to break it.
i.e.
1 PROGRAM CLOGGER.TEST.RIG
2
3
4 MSG = 'Test Prelude OORI.CC malfunction'
5 LVL = "CRITICAL"
6 NS = "prelude.oori.cc"
7 CALL CLOGGER(DQUOTE(MSG),NS,LVL)MSG can have embedded single, double, and possible ampersands.
The routine CLOGGER is:
1 SUBROUTINE CLOGGER(MSG,NS,LVL)
2 *
3 * Commerce Application Logger
4 *
5 PCPERFORM "clogger.py --msg " : MSG : " --namespace " : NS : " -l ": LVL
6 RETURNI was considering using base64 encoding, but that will greatly increase the length of MSG, and doesn't really solve the problem.
Thoughts? I guess I am looking for an equivalent to the python Pickle module's functionality.