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 3.0 "Montgomery Scott" on Wed Feb 19 20:06:34 2020 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

The source files are relatively well documented, so we recommend looking at them, but here's a quickstart guide.

Notice

Basic Usage

To load cl-syslog, use Quicklisp or ASDF as usual:

> (ql:quickload :cl-syslog)
;; or, if ASDF can already see it:
> (asdf:load-system :cl-syslog)

Priorities and facilities are stated by their keyword name. For instance, the priority :warning on facility :user. All of these keywords are housed in the variables *priorities* and *variables*. Should you provide invalid facilities or priorities, the conditions cl-syslog:invalid-facility and cl-syslog:invalid-priority will be signaled.

To log to your local syslog daemon, use cl-syslog:log (note that this is shadowed, and is obviously not the same as cl:log!):

> (cl-syslog:log "MyApp" ':user ':warning "Low on memory.")

Then look in your /var/log/messages or other location if you have tweaked your /etc/syslog.conf. On macOS, you can use the Console application.

RFC 5424 Support

RFC 5424 is supported. (You can check if your CL-SYSLOG installation support it by checking if cl-syslog::rfc5424 is present in your *features*.)

The first thing you'll need to do is create an instance of the rfc5424-logger class, filling out as many details as you please. You're encouraged to fill out as many slots as you can so that log messages contain more information.

Of particular interest is the :log-writer initarg. This controls how log messages get processed in the end. The default log writer will use a function wrapping cl-syslog:log. Should you instead be interested in writing to standard output, you can supply (cl-syslog:stream-log-writer) as an argument, like so:

(defparameter *logger*
 (make-instance 'cl-syslog:rfc5424-logger
                ;; optional
                :facility ':local0
                :app-name "MyApp"
                :hostname "computer.local"
                :log-writer (cl-syslog:stream-log-writer)))

There are a few options for log writers, including a UDP log writer for remote RFC-compliant logging. You can always support your own lambda function, too.

Once you have a logger, the simplest way to create a compliant message is to use cl-syslog:format-log:

> (cl-syslog:format-log *logger* ':warning "Low on memory.")
<132>1 2018-12-13T22:17:56Z computer.local MyApp 69840 - - Low on memory.

RFC 5424 has support for sending structured data within the log message. It's a somewhat complicated arrangement, in that the structured data has to be defined and "agreed upon". Specifically, there are a set of IETF-approved structured data. They're identified by "structured data IDs", and the standard IDs are timeQuality, origin, and meta. Each of these have different structured data parameters.

Personal structured data IDs must have some name, followed by @, followed by a usually 4 or 5 digit integer. For instance, mycompany@0001 is a valid personal structured data ID. One can define a structured data ID using cl-syslog:define-structured-data-id. The definition of the standard origin ID is:

(define-structured-data-id |origin| (:standard t)
  (|ip| :allow-repetitions t
        :validator 'ip-address-p)
  |enterpriseId|
  (|software| :length (integer 0 40))
  (|swVersion| :length (integer 0 32)))

(This can be seen in the file rfc5424-reserved.lisp.)

Your own structured data ID might be:

(cl-syslog:define-structured-data-id |mycompany@0001| ()
  |who|
  |what|)

Note that the field names are escaped to follow the RFC's usual idiom. Also node that the field names are here symbols scoped to your package. CL-SYSLOG exports all of the symbols of the standard ID's.

How can we use these? We use the log macro rfc-log. It's a macro because it does extra work at compile time to build code that only runs if the log message is to be sent.

Suppose we've defined the above structured data ID. Then we might log the following:

> (cl-syslog:rfc-log (*logger* :warning "Running out of memory! I got ~D byte~:P left!" 10)
    (cl-syslog:|origin|
     cl-syslog:|ip| "1.2.3.4"
     cl-syslog:|software| "My Testing App"
     cl-syslog:|swVersion| "12.2")
    (|mycompany@0001|
     |who| "John Doe"
     |what| "Needs to buy a new computer."))

;; output:
<132>1 2018-12-13T22:28:02Z computer.local MyApp 69840 - [origin ip="1.2.3.4" software="My Testing App" swVersion="12.2"][mycompany@0001 who="John Doe" what="Needs to buy a new computer."] Running out of memory! I got 10 bytes left!

Optionally, a message ID string can be supplied. This is useful if the message is a part of a category of similar messages. Suppose the message ID is "LOG1234", then we could write the above message as:

> (cl-syslog:rfc-log (*logger* :warning "Running out of memory! I got ~D byte~:P left!" 10)
    (:msgid "LOG1234")
    (cl-syslog:|origin|
     cl-syslog:|ip| "1.2.3.4"
     cl-syslog:|software| "My Testing App"
     cl-syslog:|swVersion| "12.2")
    (|mycompany@0001|
     |who| "John Doe"
     |what| "Needs to buy a new computer."))

;; output:
<132>1 2018-12-13T22:29:36Z computer.local MyApp 69840 LOG1234 [origin ip="1.2.3.4" software="My Testing App" swVersion="12.2"][mycompany@0001 who="John Doe" what="Needs to buy a new computer."] Running out of memory! I got 10 bytes left!

RFC 5424 Caveats

Currently, Unicode isn't properly handled. It is expected all data is ASCII. It is also expect that your Lisp's char-code matches ASCII. The necessary BOM will not be inserted for Unicode.

The RFC 5424 log handling functions generally write to streams, but the entry points cons up strings (if and only if the log message is actually sent). There is currently no support for allowing streaming log data at the log generation level.

Many log processors do not implement all of RFC 5424, but nonetheless cope rather well with the format, and can understand the RFC's key=value pairs.

Raw C Functions

The raw C interfaces are CFFI-accessible by their standard UNIX names: openlog, closelog, and syslog. None of these are necessary unless you are looking for complete control. Beware, if you mess these calls up, you will break your Lisp process.


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

2 Systems

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


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

2.1 cl-syslog

Author

Erik Enge, Mike Maul, Robert Smith

License

MIT (See LICENSE)

Description

Common Lisp syslog interface.

Version

0.2.4

Dependencies
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

cl-syslog (system)


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

3.1.2 cl-syslog/package.lisp

Parent

cl-syslog (system)

Location

package.lisp

Packages

cl-syslog


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

3.1.3 cl-syslog/variable.lisp

Parent

cl-syslog (system)

Location

variable.lisp

Exported Definitions
Internal Definitions

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

3.1.4 cl-syslog/cl-syslog.lisp

Parent

cl-syslog (system)

Location

cl-syslog.lisp

Exported Definitions
Internal Definitions

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

3.1.5 cl-syslog/rfc5424.lisp

Parent

cl-syslog (system)

Location

rfc5424.lisp

Exported Definitions
Internal Definitions

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

3.1.6 cl-syslog/rfc5424-reserved.lisp

Parent

cl-syslog (system)

Location

rfc5424-reserved.lisp

Internal Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 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: define-structured-data-id ID-NAME (&key ALLOW-OTHER-PARAMS STANDARD) &body BODY

Define a new structured data ID named ID-NAME.

ALLOW-OTHER-PARAMS is an option to allow other named parameters to be present.

STANDARD is an option to dictate that the defined message is an IETF-reserved name.

BODY specifies the fields and has the following syntax:

<body> ::= <field>*

<field> ::= <symbol>
| (<symbol> [:allow-repetitions <boolean>]
[:length <length-type>]
[:validator <form>])

<length-type> ::= an unevaluated form that is a subtype of UNSIGNED-BYTE

<form> ::= an evaluated form producing a funcallable unary function mapping to booleans

The :ALLOW-REPETITIONS keyword allows a field to be repeated (default: nil).

The :LENGTH keyword specifies what the length of the string data must satisfy. By default it’s unbounded by UNSIGNED-BYTE.

The :VALIDATOR keyword allows a validating function to be provided. By default it is (CONSTANTLY T).

Package

cl-syslog

Source

rfc5424.lisp (file)

Macro: rfc-log (LOGGER PRIORITY CONTROL &rest ARGS) &body STRUCTURED-DATA

Log the message formed by CONTROL and ARGS to the logger LOGGER with priority PRIORITY. Structured data should be a list of structured data clauses of the form, where each clause has the form: (:MSGID <string>)

or

(<ID> <PARAM 1> <VALUE 1>
<PARAM 2> <VALUE 2>
...)

The data <ID> and <PARAM n> are symbols, while <VALUE n> are strings. Both <ID> and <PARAM n> are *not* evaluated, while <VALUE n> are evaluated.

If :MSGID is provided, then this will be the RFC5424 msgid of the log message.

The logging will only happen of LOGGER does not exceed a specified maximum priority value.

Package

cl-syslog

Source

rfc5424.lisp (file)

Macro: syslog PRIORITY FORMAT &rest VARARGS0
Package

cl-syslog

Source

cl-syslog.lisp (file)


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

5.1.3 Functions

Function: closelog ()
Package

cl-syslog

Source

cl-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: join-log-writers &rest WRITERS

Create a new log writer (for an RFC5424-LOGGER instance) joining the effects of each of the supplied log writers WRITERS.

Package

cl-syslog

Source

rfc5424.lisp (file)

Function: log NAME FACILITY PRIORITY TEXT &optional OPTION

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

Package

cl-syslog

Source

cl-syslog.lisp (file)

Function: null-log-writer ()

Create a log writer (for an RFC5424-LOGGER instance) that does nothing.

Package

cl-syslog

Source

rfc5424.lisp (file)

Function: openlog IDENT OPTION FACILITY
Package

cl-syslog

Source

cl-syslog.lisp (file)

Function: stream-log-writer &optional STREAM

Create a log function (for an RFC5424-LOGGER instance) that writes to STREAM. By default this is *STANDARD-OUTPUT*.

Package

cl-syslog

Source

rfc5424.lisp (file)

Function: syslog-log-writer APP-NAME FACILITY

Create a log writer (for an RFC5424-LOGGER instance) that writes to the system’s syslog.

Package

cl-syslog

Source

rfc5424.lisp (file)

Function: tee-to-stream LOG-WRITER &optional STREAM

Create a log writer (for an RFC5424-LOGGER instance) that writes to STREAM, but is also processed by LOG-WRITER.

Package

cl-syslog

Source

rfc5424.lisp (file)

Function: udp-log-writer HOST PORT

Create a log writer (for an RFC5424-LOGGER instance) that writes to the UDP endpoint HOST on poort PORT.

Package

cl-syslog

Source

rfc5424.lisp (file)


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

5.1.4 Generic functions

Generic Function: current-time LOGGER

Return values YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, FRACTION-OF-A-SECOND.

Package

cl-syslog

Source

rfc5424.lisp (file)

Methods
Method: current-time (LOGGER rfc5424-logger)
Generic Function: format-log LOGGER PRIORITY CONTROL &rest ARGS

Log the simple message STRING according to the priority PRIORITY. Note that this function behaves like CL:FORMAT, so ~’s in the CONTROL string will be interpreted as such.

This should be used in the simplest of logging situations. For more complicated log messages that contain structured data, see the RFC-LOG macro.

Package

cl-syslog

Source

rfc5424.lisp (file)

Methods
Method: format-log (LOGGER rfc5424-logger) PRIORITY CONTROL &rest ARGS

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

5.1.5 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)

Condition: malformed-rfc5424-input ()
Package

cl-syslog

Source

rfc5424.lisp (file)

Direct superclasses

error (condition)

Direct methods

violated-assertion (method)

Direct slots
Slot: violated-assertion
Initargs

:violated-assertion

Readers

violated-assertion (generic function)


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

5.1.6 Classes

Class: rfc5424-logger ()

Class holding the state to construct and transmit an RFC 5424-compliant log message.

Package

cl-syslog

Source

rfc5424.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: facility

The syslog facility, as a keyword.

Initargs

:facility

Readers

logger-facility (generic function)

Slot: maximum-priority

The maximum priority above which log messages are not emitted to the external logging facility. The default maximum priority is :INFO. (Recall that priorities of *increasing* severity have *decreasing* priority values.)

Initargs

:maximum-priority

Readers

logger-maximum-priority (generic function)

Slot: hostname
Initargs

:hostname

Readers

logger-hostname (generic function)

Slot: app-name
Initargs

:app-name

Readers

logger-app-name (generic function)

Slot: process-id
Initargs

:process-id

Readers

logger-process-id (generic function)

Slot: log-writer

A binary function that takes a priority keyword and a string and returns an unspecified value. This is the function that received log messages and does whatever is desired. A NIL initarg (the default) means strings will be logged to syslog with the associated facility (as if by SYSLOG-LOG-WRITER).

Example: A value of (CONSTANTLY NIL) is appropriate if no action is desired.

Example: A value akin to (lambda (p s) (write-line s)) is appropriate if all log messages should go to *STANDARD-OUTPUT*. Note that this can be done with (STREAM-LOG-WRITER).

Note: This isn’t a "writer" in the usual CLOS sense.

See also: The functions NULL-LOG-WRITER, SYSLOG-LOG-WRITER, STREAM-LOG-WRITER, TEE-TO-STREAM, UDP-LOG-WRITER.

Initargs

:log-writer

Readers

logger-log-writer (generic function)

Direct Default Initargs
InitargValue
:facility(quote :user)
:maximum-priority(quote :info)
:hostname(machine-instance)
:app-namenil
:process-id(prin1-to-string (sb-posix:getpid))
:log-writernil

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

5.2 Internal definitions


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

5.2.1 Constants

Constant: nilvalue

The RFC 5424 "NILVALUE".

Package

cl-syslog

Source

rfc5424.lisp (file)


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

5.2.2 Special variables

Special Variable: *facilities*
Package

cl-syslog

Source

variable.lisp (file)

Special Variable: *priorities*
Package

cl-syslog

Source

variable.lisp (file)


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

5.2.3 Macros

Macro: assert-rfc5424 THING
Package

cl-syslog

Source

rfc5424.lisp (file)


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

5.2.4 Functions

Function: ascii-char-p C
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: ascii-control-char-p C
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: ascii-graphic-char-p C
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: ascii-graphic-string-p X
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: ascii-whitespace-char-p C
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: copy-structured-data-description INSTANCE
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: copy-structured-data-field-description INSTANCE
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: find-sd-id NAME
Function: (setf find-sd-id) NEW-VALUE NAME
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: ip-address-p X
Package

cl-syslog

Source

rfc5424-reserved.lisp (file)

Function: ip4-address-p X
Package

cl-syslog

Source

rfc5424-reserved.lisp (file)

Function: ip6-address-p X
Package

cl-syslog

Source

rfc5424-reserved.lisp (file)

Function: make-param NAME VALUE
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: make-sd-element ID &rest PARAMS
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: make-structured-data-description &key (ID ID) (ALLOW-OTHER-PARAMS ALLOW-OTHER-PARAMS) (FIELDS FIELDS)
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: make-structured-data-field-description &key (NAME NAME) (REPETITIONS-ALLOWED-P REPETITIONS-ALLOWED-P) (LENGTH-TYPE LENGTH-TYPE) (VALIDATOR VALIDATOR)
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: param-name PARAM
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: param-value PARAM
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: sd-element-id ELT
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: sd-element-params ELT
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: structured-data-description-allow-other-params INSTANCE
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: structured-data-description-fields INSTANCE
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: structured-data-description-id INSTANCE
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: structured-data-description-p OBJECT
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: structured-data-field-description-length-type INSTANCE
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: structured-data-field-description-name INSTANCE
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: structured-data-field-description-p OBJECT
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: structured-data-field-description-repetitions-allowed-p INSTANCE
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: structured-data-field-description-validator INSTANCE
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-app-name-p THING
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-day-p X
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-enterprise-number-p STRING

Is the string STRING a valid enterprise number?

Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-fraction-of-a-second-p X
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-hostname-p THING
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-hour-p X
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-minute-p X
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-month-p X
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-msgid-p THING
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-param-p P
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-pri-p THING
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-procid-p THING
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-sd-element-p E
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-sd-id-p X

Is X a valid structured data ID? Roughly, these are either:

1. A bare ASCII name, in which case it’s an IETF-reserved name.

2. An ASCII name, followed by ’@’, followed by a number (which may have dots).

Return two values:

1. A Boolean indicating whether it’s a valid ID.

2. A Boolean indicating whether its name conforms to an IETF-reserved name.

Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-sd-name-p STRING
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-second-p X
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: valid-year-p X
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-app-name STREAM APP-NAME
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-date STREAM YEAR MONTH DAY
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-hostname STREAM HOSTNAME
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-msg STREAM STRING
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-msgid STREAM MSGID
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-param-name STREAM STRING

Write out the PARAM-NAME STRING to the stream STREAM.

Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-param-value STREAM STRING

Write out the PARAM-VALUE STRING to the stream STREAM.

Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-pri STREAM PRI
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-procid STREAM PROCID
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-rfc5424-syslog-message STREAM PRI YEAR MONTH DAY HOUR MINUTE SECOND FRACTION-OF-A-SECOND HOSTNAME APP-NAME PROCID MSGID SD-ELEMENTS MSG

Write the RFC 5424-compliant syslog message to the stream STREAM.

Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-rfc5424-syslog-message-unsafe STREAM PRI YEAR MONTH DAY HOUR MINUTE SECOND FRACTIONS-OF-A-SECOND HOSTNAME APP-NAME PROCID MSGID SD-ELEMENTS MSG
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-sd-element STREAM ELT
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-sd-elements STREAM ELTS
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-time STREAM HOUR MINUTE SECOND FRACTION-OF-A-SECOND
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-two-digit-number STREAM NUMBER
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-utc-timestamp STREAM YEAR MONTH DAY HOUR MINUTE SECOND FRACTION-OF-A-SECOND
Package

cl-syslog

Source

rfc5424.lisp (file)

Function: write-version STREAM
Package

cl-syslog

Source

rfc5424.lisp (file)


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

5.2.5 Generic functions

Generic Function: facility CONDITION
Package

cl-syslog

Methods
Method: facility (CONDITION invalid-facility)
Source

cl-syslog.lisp (file)

Generic Function: logger-app-name OBJECT
Package

cl-syslog

Methods
Method: logger-app-name (RFC5424-LOGGER rfc5424-logger)

automatically generated reader method

Source

rfc5424.lisp (file)

Generic Function: logger-facility OBJECT
Package

cl-syslog

Methods
Method: logger-facility (RFC5424-LOGGER rfc5424-logger)

The syslog facility, as a keyword.

Source

rfc5424.lisp (file)

Generic Function: logger-hostname OBJECT
Package

cl-syslog

Methods
Method: logger-hostname (RFC5424-LOGGER rfc5424-logger)

automatically generated reader method

Source

rfc5424.lisp (file)

Generic Function: logger-log-writer OBJECT
Package

cl-syslog

Methods
Method: logger-log-writer (RFC5424-LOGGER rfc5424-logger)

A binary function that takes a priority keyword and a string and returns an unspecified value. This is the function that received log messages and does whatever is desired. A NIL initarg (the default) means strings will be logged to syslog with the associated facility (as if by SYSLOG-LOG-WRITER).

Example: A value of (CONSTANTLY NIL) is appropriate if no action is desired.

Example: A value akin to (lambda (p s) (write-line s)) is appropriate if all log messages should go to *STANDARD-OUTPUT*. Note that this can be done with (STREAM-LOG-WRITER).

Note: This isn’t a "writer" in the usual CLOS sense.

See also: The functions NULL-LOG-WRITER, SYSLOG-LOG-WRITER, STREAM-LOG-WRITER, TEE-TO-STREAM, UDP-LOG-WRITER.

Source

rfc5424.lisp (file)

Generic Function: logger-maximum-priority OBJECT
Package

cl-syslog

Methods
Method: logger-maximum-priority (RFC5424-LOGGER rfc5424-logger)

The maximum priority above which log messages are not emitted to the external logging facility. The default maximum priority is :INFO. (Recall that priorities of *increasing* severity have *decreasing* priority values.)

Source

rfc5424.lisp (file)

Generic Function: logger-process-id OBJECT
Package

cl-syslog

Methods
Method: logger-process-id (RFC5424-LOGGER rfc5424-logger)

automatically generated reader method

Source

rfc5424.lisp (file)

Generic Function: priority CONDITION
Package

cl-syslog

Methods
Method: priority (CONDITION invalid-priority)
Source

cl-syslog.lisp (file)

Generic Function: violated-assertion CONDITION
Package

cl-syslog

Methods
Method: violated-assertion (CONDITION malformed-rfc5424-input)
Source

rfc5424.lisp (file)


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

5.2.6 Structures

Structure: structured-data-description ()

A description of structured data.

Package

cl-syslog

Source

rfc5424.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: id
Type

alexandria.1.0.0:string-designator

Readers

structured-data-description-id (function)

Writers

(setf structured-data-description-id) (function)

Slot: allow-other-params
Type

boolean

Initform

t

Readers

structured-data-description-allow-other-params (function)

Writers

(setf structured-data-description-allow-other-params) (function)

Slot: fields
Type

alexandria.1.0.0:proper-list

Readers

structured-data-description-fields (function)

Writers

(setf structured-data-description-fields) (function)

Structure: structured-data-field-description ()

A description of a field of structured data.

Package

cl-syslog

Source

rfc5424.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: name
Type

alexandria.1.0.0:string-designator

Readers

structured-data-field-description-name (function)

Writers

(setf structured-data-field-description-name) (function)

Slot: repetitions-allowed-p
Type

boolean

Readers

structured-data-field-description-repetitions-allowed-p (function)

Writers

(setf structured-data-field-description-repetitions-allowed-p) (function)

Slot: length-type
Initform

(quote unsigned-byte)

Readers

structured-data-field-description-length-type (function)

Writers

(setf structured-data-field-description-length-type) (function)

Slot: validator
Type

(or symbol function)

Initform

(constantly t)

Readers

structured-data-field-description-validator (function)

Writers

(setf structured-data-field-description-validator) (function)


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

5.2.7 Types

Type: rfc5424-pri ()
Package

cl-syslog

Source

rfc5424.lisp (file)


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․asd file
cl-syslog/cl-syslog.lisp: The cl-syslog/cl-syslog․lisp file
cl-syslog/package.lisp: The cl-syslog/package․lisp file
cl-syslog/rfc5424-reserved.lisp: The cl-syslog/rfc5424-reserved․lisp file
cl-syslog/rfc5424.lisp: The cl-syslog/rfc5424․lisp file
cl-syslog/variable.lisp: The cl-syslog/variable․lisp file

F
File, Lisp, cl-syslog.asd: The cl-syslog․asd file
File, Lisp, cl-syslog/cl-syslog.lisp: The cl-syslog/cl-syslog․lisp file
File, Lisp, cl-syslog/package.lisp: The cl-syslog/package․lisp file
File, Lisp, cl-syslog/rfc5424-reserved.lisp: The cl-syslog/rfc5424-reserved․lisp file
File, Lisp, cl-syslog/rfc5424.lisp: The cl-syslog/rfc5424․lisp file
File, Lisp, cl-syslog/variable.lisp: The cl-syslog/variable․lisp file

L
Lisp File, cl-syslog.asd: The cl-syslog․asd file
Lisp File, cl-syslog/cl-syslog.lisp: The cl-syslog/cl-syslog․lisp file
Lisp File, cl-syslog/package.lisp: The cl-syslog/package․lisp file
Lisp File, cl-syslog/rfc5424-reserved.lisp: The cl-syslog/rfc5424-reserved․lisp file
Lisp File, cl-syslog/rfc5424.lisp: The cl-syslog/rfc5424․lisp file
Lisp File, cl-syslog/variable.lisp: The cl-syslog/variable․lisp file

Jump to:   C   F   L  

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

A.2 Functions

Jump to:   (  
A   C   D   F   G   I   J   L   M   N   O   P   R   S   T   U   V   W  
Index Entry  Section

(
(setf find-sd-id): Internal functions

A
ascii-char-p: Internal functions
ascii-control-char-p: Internal functions
ascii-graphic-char-p: Internal functions
ascii-graphic-string-p: Internal functions
ascii-whitespace-char-p: Internal functions
assert-rfc5424: Internal macros

C
closelog: Exported functions
copy-structured-data-description: Internal functions
copy-structured-data-field-description: Internal functions
current-time: Exported generic functions
current-time: Exported generic functions

D
define-structured-data-id: Exported macros

F
facility: Internal generic functions
facility: Internal generic functions
find-sd-id: Internal functions
format-log: Exported generic functions
format-log: Exported generic functions
Function, (setf find-sd-id): Internal functions
Function, ascii-char-p: Internal functions
Function, ascii-control-char-p: Internal functions
Function, ascii-graphic-char-p: Internal functions
Function, ascii-graphic-string-p: Internal functions
Function, ascii-whitespace-char-p: Internal functions
Function, closelog: Exported functions
Function, copy-structured-data-description: Internal functions
Function, copy-structured-data-field-description: Internal functions
Function, find-sd-id: Internal functions
Function, get-facility: Exported functions
Function, get-priority: Exported functions
Function, ip-address-p: Internal functions
Function, ip4-address-p: Internal functions
Function, ip6-address-p: Internal functions
Function, join-log-writers: Exported functions
Function, log: Exported functions
Function, make-param: Internal functions
Function, make-sd-element: Internal functions
Function, make-structured-data-description: Internal functions
Function, make-structured-data-field-description: Internal functions
Function, null-log-writer: Exported functions
Function, openlog: Exported functions
Function, param-name: Internal functions
Function, param-value: Internal functions
Function, sd-element-id: Internal functions
Function, sd-element-params: Internal functions
Function, stream-log-writer: Exported functions
Function, structured-data-description-allow-other-params: Internal functions
Function, structured-data-description-fields: Internal functions
Function, structured-data-description-id: Internal functions
Function, structured-data-description-p: Internal functions
Function, structured-data-field-description-length-type: Internal functions
Function, structured-data-field-description-name: Internal functions
Function, structured-data-field-description-p: Internal functions
Function, structured-data-field-description-repetitions-allowed-p: Internal functions
Function, structured-data-field-description-validator: Internal functions
Function, syslog-log-writer: Exported functions
Function, tee-to-stream: Exported functions
Function, udp-log-writer: Exported functions
Function, valid-app-name-p: Internal functions
Function, valid-day-p: Internal functions
Function, valid-enterprise-number-p: Internal functions
Function, valid-fraction-of-a-second-p: Internal functions
Function, valid-hostname-p: Internal functions
Function, valid-hour-p: Internal functions
Function, valid-minute-p: Internal functions
Function, valid-month-p: Internal functions
Function, valid-msgid-p: Internal functions
Function, valid-param-p: Internal functions
Function, valid-pri-p: Internal functions
Function, valid-procid-p: Internal functions
Function, valid-sd-element-p: Internal functions
Function, valid-sd-id-p: Internal functions
Function, valid-sd-name-p: Internal functions
Function, valid-second-p: Internal functions
Function, valid-year-p: Internal functions
Function, write-app-name: Internal functions
Function, write-date: Internal functions
Function, write-hostname: Internal functions
Function, write-msg: Internal functions
Function, write-msgid: Internal functions
Function, write-param-name: Internal functions
Function, write-param-value: Internal functions
Function, write-pri: Internal functions
Function, write-procid: Internal functions
Function, write-rfc5424-syslog-message: Internal functions
Function, write-rfc5424-syslog-message-unsafe: Internal functions
Function, write-sd-element: Internal functions
Function, write-sd-elements: Internal functions
Function, write-time: Internal functions
Function, write-two-digit-number: Internal functions
Function, write-utc-timestamp: Internal functions
Function, write-version: Internal functions

G
Generic Function, current-time: Exported generic functions
Generic Function, facility: Internal generic functions
Generic Function, format-log: Exported generic functions
Generic Function, logger-app-name: Internal generic functions
Generic Function, logger-facility: Internal generic functions
Generic Function, logger-hostname: Internal generic functions
Generic Function, logger-log-writer: Internal generic functions
Generic Function, logger-maximum-priority: Internal generic functions
Generic Function, logger-process-id: Internal generic functions
Generic Function, priority: Internal generic functions
Generic Function, violated-assertion: Internal generic functions
get-facility: Exported functions
get-priority: Exported functions

I
ip-address-p: Internal functions
ip4-address-p: Internal functions
ip6-address-p: Internal functions

J
join-log-writers: Exported functions

L
log: Exported functions
logger-app-name: Internal generic functions
logger-app-name: Internal generic functions
logger-facility: Internal generic functions
logger-facility: Internal generic functions
logger-hostname: Internal generic functions
logger-hostname: Internal generic functions
logger-log-writer: Internal generic functions
logger-log-writer: Internal generic functions
logger-maximum-priority: Internal generic functions
logger-maximum-priority: Internal generic functions
logger-process-id: Internal generic functions
logger-process-id: Internal generic functions

M
Macro, assert-rfc5424: Internal macros
Macro, define-structured-data-id: Exported macros
Macro, rfc-log: Exported macros
Macro, syslog: Exported macros
make-param: Internal functions
make-sd-element: Internal functions
make-structured-data-description: Internal functions
make-structured-data-field-description: Internal functions
Method, current-time: Exported generic functions
Method, facility: Internal generic functions
Method, format-log: Exported generic functions
Method, logger-app-name: Internal generic functions
Method, logger-facility: Internal generic functions
Method, logger-hostname: Internal generic functions
Method, logger-log-writer: Internal generic functions
Method, logger-maximum-priority: Internal generic functions
Method, logger-process-id: Internal generic functions
Method, priority: Internal generic functions
Method, violated-assertion: Internal generic functions

N
null-log-writer: Exported functions

O
openlog: Exported functions

P
param-name: Internal functions
param-value: Internal functions
priority: Internal generic functions
priority: Internal generic functions

R
rfc-log: Exported macros

S
sd-element-id: Internal functions
sd-element-params: Internal functions
stream-log-writer: Exported functions
structured-data-description-allow-other-params: Internal functions
structured-data-description-fields: Internal functions
structured-data-description-id: Internal functions
structured-data-description-p: Internal functions
structured-data-field-description-length-type: Internal functions
structured-data-field-description-name: Internal functions
structured-data-field-description-p: Internal functions
structured-data-field-description-repetitions-allowed-p: Internal functions
structured-data-field-description-validator: Internal functions
syslog: Exported macros
syslog-log-writer: Exported functions

T
tee-to-stream: Exported functions

U
udp-log-writer: Exported functions

V
valid-app-name-p: Internal functions
valid-day-p: Internal functions
valid-enterprise-number-p: Internal functions
valid-fraction-of-a-second-p: Internal functions
valid-hostname-p: Internal functions
valid-hour-p: Internal functions
valid-minute-p: Internal functions
valid-month-p: Internal functions
valid-msgid-p: Internal functions
valid-param-p: Internal functions
valid-pri-p: Internal functions
valid-procid-p: Internal functions
valid-sd-element-p: Internal functions
valid-sd-id-p: Internal functions
valid-sd-name-p: Internal functions
valid-second-p: Internal functions
valid-year-p: Internal functions
violated-assertion: Internal generic functions
violated-assertion: Internal generic functions

W
write-app-name: Internal functions
write-date: Internal functions
write-hostname: Internal functions
write-msg: Internal functions
write-msgid: Internal functions
write-param-name: Internal functions
write-param-value: Internal functions
write-pri: Internal functions
write-procid: Internal functions
write-rfc5424-syslog-message: Internal functions
write-rfc5424-syslog-message-unsafe: Internal functions
write-sd-element: Internal functions
write-sd-elements: Internal functions
write-time: Internal functions
write-two-digit-number: Internal functions
write-utc-timestamp: Internal functions
write-version: Internal functions

Jump to:   (  
A   C   D   F   G   I   J   L   M   N   O   P   R   S   T   U   V   W  

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

A.3 Variables

Jump to:   *   +  
A   C   F   H   I   L   M   N   P   R   S   V  
Index Entry  Section

*
*facilities*: Internal special variables
*priorities*: 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

A
allow-other-params: Internal structures
app-name: Exported classes

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
Constant, nilvalue: Internal constants

F
facility: Exported conditions
facility: Exported classes
fields: Internal structures

H
hostname: Exported classes

I
id: Internal structures

L
length-type: Internal structures
log-writer: Exported classes

M
maximum-priority: Exported classes

N
name: Internal structures
nilvalue: Internal constants

P
priority: Exported conditions
process-id: Exported classes

R
repetitions-allowed-p: Internal structures

S
Slot, allow-other-params: Internal structures
Slot, app-name: Exported classes
Slot, facility: Exported conditions
Slot, facility: Exported classes
Slot, fields: Internal structures
Slot, hostname: Exported classes
Slot, id: Internal structures
Slot, length-type: Internal structures
Slot, log-writer: Exported classes
Slot, maximum-priority: Exported classes
Slot, name: Internal structures
Slot, priority: Exported conditions
Slot, process-id: Exported classes
Slot, repetitions-allowed-p: Internal structures
Slot, validator: Internal structures
Slot, violated-assertion: Exported conditions
Special Variable, *facilities*: Internal special variables
Special Variable, *priorities*: Internal special variables

V
validator: Internal structures
violated-assertion: Exported conditions

Jump to:   *   +  
A   C   F   H   I   L   M   N   P   R   S   V  

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

A.4 Data types

Jump to:   C   I   M   P   R   S   T  
Index Entry  Section

C
cl-syslog: The cl-syslog system
cl-syslog: The cl-syslog package
Class, rfc5424-logger: Exported classes
Condition, invalid-facility: Exported conditions
Condition, invalid-priority: Exported conditions
Condition, malformed-rfc5424-input: Exported conditions

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

M
malformed-rfc5424-input: Exported conditions

P
Package, cl-syslog: The cl-syslog package

R
rfc5424-logger: Exported classes
rfc5424-pri: Internal types

S
Structure, structured-data-description: Internal structures
Structure, structured-data-field-description: Internal structures
structured-data-description: Internal structures
structured-data-field-description: Internal structures
System, cl-syslog: The cl-syslog system

T
Type, rfc5424-pri: Internal types

Jump to:   C   I   M   P   R   S   T