- Documentation
- Reference manual
- Packages
- SWI-Prolog C-library
- Introduction
- library(process): Create processes and redirect I/O
- library(filesex): Extended operations on files
- library(uid): User and group management on Unix systems
- library(syslog): Unix syslog interface
- library(socket): Network socket (TCP and UDP) library
- The stream_pool library
- library(uri): Process URIs
- CGI Support library
- Password encryption library
- library(uuid): Universally Unique Identifier (UUID) Library
- SHA* Secure Hash Algorithms
- library(md5): MD5 hashes
- library(hash_stream): Maintain a hash on a stream
- Memory files
- Time and alarm library
- library(unix): Unix specific operations
- Limiting process resources
- library(udp_broadcast): A UDP Broadcast Bridge
- library(prolog_stream): A stream with Prolog callbacks
- SWI-Prolog C-library
5 library(syslog): Unix syslog interface
- See also
- - detach_IO/1 to detach normal
I/O of the process and remove it from the process group.
- fork/1 to create a daemon process.
-library(uid)
to manage user identifiers (e.g., drop root privileges).
This library provides an interface to the Unix syslog()
facility. The interface is an almost direct translation of the POSIX
syslog API, with two additions:
- syslog/3 exploits format/3 to format syslog messages
- The library integrates into
library(debug)
using prolog:debug_print_hook/3, where debug topics are mapped to syslog priorities and remaining debug topics are mapped to the syslog prioritydebug
.
Note that this interface makes no attempt to abstract over logging
facilities of operating systems. We expect that such abstractions will
be implemented at the Prolog level using multiple integrations into
library(debug)
.
- [det]openlog(+Ident:atom, +Options:list(atom), +Facility:atom)
- Open system log. This predicate provides a direct interface into the
openlog()
library call. If the library call is successful, it runsat_halt(closelog)
to ensure closing the system log on clean exit.Ident prepended to every message, and is typically set to the program name. Options is a list of options. Values are corresponding C options, after removing =LOG_= and translation to lower case: cons
,ndelay
,nowait
,odelay
,perror
,pid
.Facility is one of auth
,authpriv
,cron
,daemon
,ftp
,kern
,local0
...local7
,lpr
,mail
,news
,syslog
,user
oruucp
. - [det]syslog(+Priority, +Message)
- Send a message to the system log. Note that syslog/2
implicitly opens a connection to the system log if such a connection has
not been opened explicitly using openlog/3.
Priority is one of emerg
,alert
,crit
,err
,warning
,notice
,info
ordebug
. - [det]syslog(+Priority, +Format, +Args)
- Send a formatted message to the system log if system logging is opened using openlog/3. This predicate combined format/3 with syslog/2. If there is no open syslog connection, syslog/3 calls print_message/2.
- [det]closelog
- Close the system log.
- [semidet,multifile]prolog:debug_print_hook(+Topic, +Format, +Args)
- Integration of debug/3 with the syslog
facility. If syslog is enabled, debug/3 is
re-routed to use the syslog facilities. If the topic of the debug
message matches one of the sylog
priority values (see syslog/2),
the message is sent with the corresponding syslog priority. Otherwise it
it sent with the
debug
priority.