Written October 2025
xcall MIAMEX, MX_SYSLOG, -1, ident, option, facility ! open/init
xcall MIAMEX, MX_SYSLOG, -2 ! close
xcall MIAMEX, MX_SYSLOG, -3, mask ! set log mask
xcall MIAMEX, MX_SYSLOG, level, msg ! output message
xcall MIAMEX, MX_SYSLOG, msg ! output message
(Linux only) MX_SYSLOG (207) outputs text to the Linux syslog facility.
Parameters:
ident (String) [in]
identifier to include with each message (defaults to 'ashell').
option (Integer) [in]
options that may be set on the open call that then carry through to the subsequent outputs. One or more of the following (OR'd together):
Symbol |
Value |
Meaning |
|---|---|---|
SYSLOG_PID |
&h01 |
include the pid with each message |
SYSLOG_CONS |
&h02 |
log on console if errors in sending |
SYSLOG_ODELAY |
&h04 |
delay open until first output (default) |
SYSLOG_NODELAY |
&h08 |
don't delay open |
SYSLOG_PERROR |
&h20 |
log to stderr as well |
facility (Integer) [in]
indicator of category of message:
Symbol |
Value |
Meaning |
|---|---|---|
SYSLOG_USER |
&h1000 |
user-level messages (default) |
Consult syslog(3) documentation for other options, although none of them seem sensible in this context, which is why they aren't documented here.
mask (Integer) [in/out]
mask bits allowing outputs to be enabled/disabled by the level of severity. (Parameter returns the original value of the mask; passing 0 preserves the original mask value, i.e. query only.)
Symbol |
Value |
Meaning: Log message to... |
|---|---|---|
SYSLOG_UPTO_EMERG |
&h0001 |
SYSLOG_EMERG |
SYSLOG_UPTO_ALERT |
&h0003 |
SYSLOG_ALERT |
SYSLOG_UPTO_CRIT |
&h0007 |
SYSLOG_CRIT |
SYSLOG_UPTO_ERR |
&h000F |
SYSLOG_ERR |
SYSLOG_UPTO_WARNING |
&h001F |
SYSLOG_WARNING |
SYSLOG_UPTO_NOTICE |
&h003F |
SYSLOG_NOTICE |
SYSLOG_UPTO_INFO |
&h007F |
SYSLOG_INFO |
SYSLOG_UPTO_DEBUG |
&h00FF |
SYSLOG_DEBUG |
level (Integer) [in]
importance of the message; one of the following:
Symbol |
Value |
Meaning... |
|---|---|---|
SYSLOG_EMERG |
0 |
system is unusable |
SYSLOG_ALERT |
1 |
action must be taken immediately |
SYSLOG_CRIT |
2 |
critical conditions |
SYSLOG_ERR |
3 |
error conditions |
SYSLOG_WARNING |
4 |
warning conditions |
SYSLOG_NOTICE |
5 |
normal but significant condition |
SYSLOG_INFO |
6 |
informational default |
SYSLOG_DEBUG |
7 |
debug-level messages |
msg (String) [in]
message to output
Comments
The open, close, and mask operations are all optional.
MX_SYSLOG is comparable to MX_ASHLOG, except that instead of writing to the A-Shell log file along with several automatic prefix fields, it uses the Linux system() function to send the specified message to the operating system logging (syslog) service. How the service handles the message is entirely dependent on the service configuration options (which in a modern Linux platform are quite extensive).
Note that in order to get a plain text log file (e.g. /var/log/syslog), you may need to install the rsyslog service and make configuration changes to /etc/rsyslog.conf, sysctl.conf and/or journald.conf or their equivalents so that the the messages get forwarded to rsyslog and written to a file.
Note that the out-of-the-box configuration is likely to echo all the messages to the console of all connected terminals, which is probably not what you want.