The cl-syslog Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-syslog Reference Manual

This is the cl-syslog Reference Manual, version 0.2.4, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:25:08 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

CL-SYSLOG Build Status

Common Lisp interface to local and remote Syslog facilities.

FEATURES

DOCUMENTATION

For UDP Syslog See udp-syslog.lisp documentation strings. For local syslog see cl-syslog.lisp and variable.lisp. Priorities and facilities documented in variable.lisp.

Examples

Local Syslog Example: * (require :cl-syslog)

* (syslog:log "myprog" :local7 :info "this is the message")

"this is the message"

* (syslog:log "myprog" :local7 :info "this is the message" 
    syslog:+log-pid+)

"this is the message"

* (syslog:log "myprog" :local7 :info "this is the message" 
    (+ syslog:+log-pid+ syslog:+log-cons+))
"this is the message"

Then look in your /var/log/messages or other location if you have tweaked your /etc/syslog.conf.

Remote Syslog Example: (require :cl-syslog) ;; Create global logger (syslog.udp:udp-logger "127.0.0.1" 514)

;; Log a message
;; (Note: the log function is signature compatible with cl-syslog:log)
(syslog.udp:log "MyApp" :local7 :info "this is the message")

;; Log using a transient logger along with ulog function
(syslog-udp:ulog "this is the message" :logger 
  (syslog-udp:udp-logger "192.168.0.5" 514 :transient t))

;; Log with prirority
(syslog.udp:ulog "this is an error" :pri :err)

Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Next: , Previous: , Up: Systems   [Contents][Index]

2.1 cl-syslog

Author

Erik Enge, Mike Maul

License

MIT (See LICENSE)

Description

Common Lisp syslog interface.

Version

0.2.4

Dependencies
Source

cl-syslog.asd (file)


Next: , Previous: , Up: Systems   [Contents][Index]

2.2 cl-syslog.udp

License

MIT (See LICENSE)

Description

Local-only syslog logging.

Version

0.2.4

Dependencies
Source

cl-syslog.asd (file)

Components

Previous: , Up: Systems   [Contents][Index]

2.3 cl-syslog.local

License

MIT (See LICENSE)

Description

Local-only syslog logging.

Version

0.2.4

Dependency

cffi

Source

cl-syslog.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cl-syslog.asd

Location

cl-syslog.asd

Systems

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cl-syslog.udp/package-udp.lisp

Parent

cl-syslog.udp (system)

Location

package-udp.lisp

Packages

cl-syslog.udp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 cl-syslog.udp/udp-syslog.lisp

Dependency

package-udp.lisp (file)

Parent

cl-syslog.udp (system)

Location

udp-syslog.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.4 cl-syslog.local/package.lisp

Parent

cl-syslog.local (system)

Location

package.lisp

Packages

cl-syslog


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.5 cl-syslog.local/variable.lisp

Dependency

package.lisp (file)

Parent

cl-syslog.local (system)

Location

variable.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.6 cl-syslog.local/cl-syslog.lisp

Dependency

variable.lisp (file)

Parent

cl-syslog.local (system)

Location

cl-syslog.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 cl-syslog.udp

UDP Syslog interface

Source

package-udp.lisp (file)

Nickname

syslog.udp

Use List
Exported Definitions
Internal Definitions

Previous: , Up: Packages   [Contents][Index]

4.2 cl-syslog

Common Lisp interface to syslog.

Source

package.lisp (file)

Nickname

syslog

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Constants

Constant: +log-cons+

Log on the console if errors in sending.

Package

cl-syslog

Source

variable.lisp (file)

Constant: +log-ndelay+

Don’t delay open.

Package

cl-syslog

Source

variable.lisp (file)

Constant: +log-nowait+

Don’t wait for console forks: deprecated.

Package

cl-syslog

Source

variable.lisp (file)

Constant: +log-odelay+

Delay open until first syslog() (default).

Package

cl-syslog

Source

variable.lisp (file)

Constant: +log-perror+

Log to stderr as well.

Package

cl-syslog

Source

variable.lisp (file)

Constant: +log-pid+

Log the pid with each message.

Package

cl-syslog

Source

variable.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Macros

Macro: log NAME FACILITY PRIORITY TEXT &optional OPTION &key PROCID TIMESTAMP LOGGER

Macro wrapping ulog providing backwards signature compatibility with cl-syslog:log function. The purpose of this is to allow the switching
of log destinations by switching bewteen the cl-syslog and cl-syslog.udp namespaces.

See documentation for ulog details not covered here.

##Parameters##
name - Application name displayed in application name section if syslog message

facility - See ulog documentation for acceptable values

priority - See ulog documentation for acceptable values

text - Body of the message

option - Ignored, however parameter is necessary to maintain signature compatibility with cl-syslog:log

:procid - See ulog documentation

:timestamp - See ulog documentation

:logger - See ulog documentation

##Return values##
value of text parameter, on error condition will be thrown.

Package

cl-syslog.udp

Source

udp-syslog.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Functions

Function: epoch-to-syslog-time &optional EPOCH &key TZ

Syslog timestamp formatter defaults to current time. Optional arg epoch as epoch seconds
Example format:2013-12-14T21:09:57.0Z-5
Timezone can be specified using local-time time zone variables for example to specify GMT use local-time:+GMT-ZONE+

Package

cl-syslog.udp

Source

udp-syslog.lisp (file)

Function: get-facility FACILITY-NAME

Return facility number given the facility’s name. If there is no such facility, signal ‘invalid-facility’ error.

Package

cl-syslog

Source

cl-syslog.lisp (file)

Function: get-priority PRIORITY-NAME

Return priority number given the priority’s name. If there is no such priority, signal ‘invalid-priority’ error.

Package

cl-syslog

Source

cl-syslog.lisp (file)

Function: log NAME FACILITY PRIORITY TEXT &optional OPTION &rest R

Print message to syslog.
’option’ can be any of the +log...+ constants

Package

cl-syslog

Source

cl-syslog.lisp (file)

Function: udp-logger HOST &key PORT TRANSIENT

Constructs a UDP socket to host:port
:transient returns udp socket with out setting global socket

Package

cl-syslog.udp

Source

udp-syslog.lisp (file)

Function: udp-logger-close &optional UDP-LOGGER-SOCKET

Closes udp socket

Package

cl-syslog.udp

Source

udp-syslog.lisp (file)

Function: ulog MSG &key PRI FAC HOSTNAME APP-NAME PROCID MSGID TIMESTAMP LOGGER

Streams a syslog formatted message (rfc5424) to a UDP destination.
Below is a sample of the equivalant string representation of a syslog
message streamed with this function:
<165>1 2003-08-24T05:14:15.000003-07:00 192.0.2.1 myproc 8710 - - %% It’s time to make the do-nuts.

##Parameters##
The paremeters map into the syslog message as shown below
:PRI VERSION SP :TIMESTAMP SP :HOSTNAME
SP :APP-NAME SP :PROCID SP :MSGID SP STRUCTURED-DATA [SP :MSG]

:logger
The destination is specified by either setting the global udp logger by
calling the udp-logger function or by specifying a logger with the
:logger parameter.

:pri
Must be one of the following priorities (default :info)
:emerg :alert :crit :err
:warning :notice :info :debug

:fac
Facility parameter must be one of (default :local7)
:kern :user :mail :daemon
:auth :syslog :lpr :news
:uucp :cron :authpriv :ftp
:local0 :local1 :local2 :local3
:local4 :local5 :local6 :local7

:app-name
Application name defaults to *package*

:hostname
Hostname defaults to (machine-instance)

Package

cl-syslog.udp

Source

udp-syslog.lisp (file)

Function: ulog-min MSG &key PRI FAC LOGGER

Streams a syslog formatted message (rfc5424) to a UDP destination.
Below is a sample of the equivalant string representation of a syslog
message streamed with this function:
<165>1 2003-08-24T05:14:15.000003-07:00 192.0.2.1 myproc 8710 - - %% It’s time to make the do-nuts.

##Parameters##
The paremeters map into the syslog message as shown below
:PRI VERSION SP :TIMESTAMP SP :HOSTNAME
SP :APP-NAME SP :PROCID SP :MSGID SP STRUCTURED-DATA [SP :MSG]

:logger
The destination is specified by either setting the global udp logger by
calling the udp-logger function or by specifying a logger with the
:logger parameter.

:pri
Must be one of the following priorities (default :info)
:emerg :alert :crit :err
:warning :notice :info :debug

:fac
Facility parameter must be one of (default :local7)
:kern :user :mail :daemon
:auth :syslog :lpr :news
:uucp :cron :authpriv :ftp
:local0 :local1 :local2 :local3
:local4 :local5 :local6 :local7

:app-name
Application name defaults to *package*

:hostname
Hostname defaults to (machine-instance)

Package

cl-syslog.udp

Source

udp-syslog.lisp (file)

Function: ulog-raw MESSAGE &key LOGGER

Streams contents of message string to UDP destination.
If a strict syslog formatted message is desired see (ulog ...), otherwise this function would be okay to simple udp listener.

##Parameters##
:logger
The destination is specified by either setting the global udp logger by calling the udp-logger function or by specifying a logger with the :logger parameter.

Package

cl-syslog.udp

Source

udp-syslog.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.4 Conditions

Condition: invalid-facility ()
Package

cl-syslog

Source

cl-syslog.lisp (file)

Direct superclasses

error (condition)

Direct methods

facility (method)

Direct slots
Slot: facility
Initargs

:facility

Readers

facility (generic function)

Condition: invalid-priority ()
Package

cl-syslog

Source

cl-syslog.lisp (file)

Direct superclasses

error (condition)

Direct methods

priority (method)

Direct slots
Slot: priority
Initargs

:priority

Readers

priority (generic function)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *facilities*
Package

cl-syslog

Source

variable.lisp (file)

Special Variable: *priorities*
Package

cl-syslog

Source

variable.lisp (file)

Special Variable: *udp-syslog-socket*
Package

cl-syslog.udp

Source

udp-syslog.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: closelog ()
Package

cl-syslog

Source

cl-syslog.lisp (file)

Function: getpid ()
Package

cl-syslog.udp

Source

udp-syslog.lisp (file)

Function: openlog IDENT OPTION FACILITY
Package

cl-syslog

Source

cl-syslog.lisp (file)

Function: syslog PRIORITY FORMAT
Package

cl-syslog

Source

cl-syslog.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Generic functions

Generic Function: facility CONDITION
Package

cl-syslog

Methods
Method: facility (CONDITION invalid-facility)
Source

cl-syslog.lisp (file)

Generic Function: msg CONDITION
Package

cl-syslog.udp

Methods
Method: msg (CONDITION unset-logger)
Source

udp-syslog.lisp (file)

Generic Function: priority CONDITION
Package

cl-syslog

Methods
Method: priority (CONDITION invalid-priority)
Source

cl-syslog.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Conditions

Condition: unset-logger ()
Package

cl-syslog.udp

Source

udp-syslog.lisp (file)

Direct superclasses

error (condition)

Direct methods

msg (method)

Direct slots
Slot: msg
Initargs

:msg

Readers

msg (generic function)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-syslog.asd: The cl-syslog<dot>asd file
cl-syslog.local/cl-syslog.lisp: The cl-syslog<dot>local/cl-syslog<dot>lisp file
cl-syslog.local/package.lisp: The cl-syslog<dot>local/package<dot>lisp file
cl-syslog.local/variable.lisp: The cl-syslog<dot>local/variable<dot>lisp file
cl-syslog.udp/package-udp.lisp: The cl-syslog<dot>udp/package-udp<dot>lisp file
cl-syslog.udp/udp-syslog.lisp: The cl-syslog<dot>udp/udp-syslog<dot>lisp file

F
File, Lisp, cl-syslog.asd: The cl-syslog<dot>asd file
File, Lisp, cl-syslog.local/cl-syslog.lisp: The cl-syslog<dot>local/cl-syslog<dot>lisp file
File, Lisp, cl-syslog.local/package.lisp: The cl-syslog<dot>local/package<dot>lisp file
File, Lisp, cl-syslog.local/variable.lisp: The cl-syslog<dot>local/variable<dot>lisp file
File, Lisp, cl-syslog.udp/package-udp.lisp: The cl-syslog<dot>udp/package-udp<dot>lisp file
File, Lisp, cl-syslog.udp/udp-syslog.lisp: The cl-syslog<dot>udp/udp-syslog<dot>lisp file

L
Lisp File, cl-syslog.asd: The cl-syslog<dot>asd file
Lisp File, cl-syslog.local/cl-syslog.lisp: The cl-syslog<dot>local/cl-syslog<dot>lisp file
Lisp File, cl-syslog.local/package.lisp: The cl-syslog<dot>local/package<dot>lisp file
Lisp File, cl-syslog.local/variable.lisp: The cl-syslog<dot>local/variable<dot>lisp file
Lisp File, cl-syslog.udp/package-udp.lisp: The cl-syslog<dot>udp/package-udp<dot>lisp file
Lisp File, cl-syslog.udp/udp-syslog.lisp: The cl-syslog<dot>udp/udp-syslog<dot>lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   C   E   F   G   L   M   O   P   S   U  
Index Entry  Section

C
closelog: Internal functions

E
epoch-to-syslog-time: Exported functions

F
facility: Internal generic functions
facility: Internal generic functions
Function, closelog: Internal functions
Function, epoch-to-syslog-time: Exported functions
Function, get-facility: Exported functions
Function, get-priority: Exported functions
Function, getpid: Internal functions
Function, log: Exported functions
Function, openlog: Internal functions
Function, syslog: Internal functions
Function, udp-logger: Exported functions
Function, udp-logger-close: Exported functions
Function, ulog: Exported functions
Function, ulog-min: Exported functions
Function, ulog-raw: Exported functions

G
Generic Function, facility: Internal generic functions
Generic Function, msg: Internal generic functions
Generic Function, priority: Internal generic functions
get-facility: Exported functions
get-priority: Exported functions
getpid: Internal functions

L
log: Exported macros
log: Exported functions

M
Macro, log: Exported macros
Method, facility: Internal generic functions
Method, msg: Internal generic functions
Method, priority: Internal generic functions
msg: Internal generic functions
msg: Internal generic functions

O
openlog: Internal functions

P
priority: Internal generic functions
priority: Internal generic functions

S
syslog: Internal functions

U
udp-logger: Exported functions
udp-logger-close: Exported functions
ulog: Exported functions
ulog-min: Exported functions
ulog-raw: Exported functions

Jump to:   C   E   F   G   L   M   O   P   S   U  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *   +  
C   F   M   P   S  
Index Entry  Section

*
*facilities*: Internal special variables
*priorities*: Internal special variables
*udp-syslog-socket*: Internal special variables

+
+log-cons+: Exported constants
+log-ndelay+: Exported constants
+log-nowait+: Exported constants
+log-odelay+: Exported constants
+log-perror+: Exported constants
+log-pid+: Exported constants

C
Constant, +log-cons+: Exported constants
Constant, +log-ndelay+: Exported constants
Constant, +log-nowait+: Exported constants
Constant, +log-odelay+: Exported constants
Constant, +log-perror+: Exported constants
Constant, +log-pid+: Exported constants

F
facility: Exported conditions

M
msg: Internal conditions

P
priority: Exported conditions

S
Slot, facility: Exported conditions
Slot, msg: Internal conditions
Slot, priority: Exported conditions
Special Variable, *facilities*: Internal special variables
Special Variable, *priorities*: Internal special variables
Special Variable, *udp-syslog-socket*: Internal special variables

Jump to:   *   +  
C   F   M   P   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   I   P   S   U  
Index Entry  Section

C
cl-syslog: The cl-syslog system
cl-syslog: The cl-syslog package
cl-syslog.local: The cl-syslog<dot>local system
cl-syslog.udp: The cl-syslog<dot>udp system
cl-syslog.udp: The cl-syslog<dot>udp package
Condition, invalid-facility: Exported conditions
Condition, invalid-priority: Exported conditions
Condition, unset-logger: Internal conditions

I
invalid-facility: Exported conditions
invalid-priority: Exported conditions

P
Package, cl-syslog: The cl-syslog package
Package, cl-syslog.udp: The cl-syslog<dot>udp package

S
System, cl-syslog: The cl-syslog system
System, cl-syslog.local: The cl-syslog<dot>local system
System, cl-syslog.udp: The cl-syslog<dot>udp system

U
unset-logger: Internal conditions

Jump to:   C   I   P   S   U