The cl-syslog Reference Manual

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 4.0 beta 2 "William Riker" on Mon Aug 15 04:04:46 2022 GMT+0.

Table of Contents


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.


2 Systems

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


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

2.1 cl-syslog

Common Lisp syslog interface.

Author

Erik Enge, Mike Maul, Robert Smith

License

MIT (See LICENSE)

Version

0.2.4

Dependencies
  • alexandria (system).
  • cffi (system).
  • global-vars (system).
  • usocket (system).
  • split-sequence (system).
  • babel (system).
  • local-time (system).
  • sb-posix (system).
Source

cl-syslog.asd.

Child Components

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   [Contents][Index]

3.1.1 cl-syslog/cl-syslog.asd

Source

cl-syslog.asd.

Parent Component

cl-syslog (system).

ASDF Systems

cl-syslog.


3.1.2 cl-syslog/package.lisp

Source

cl-syslog.asd.

Parent Component

cl-syslog (system).

Packages

cl-syslog.


3.1.3 cl-syslog/variable.lisp

Source

cl-syslog.asd.

Parent Component

cl-syslog (system).

Public Interface
Internals

3.1.4 cl-syslog/cl-syslog.lisp

Source

cl-syslog.asd.

Parent Component

cl-syslog (system).

Public Interface
Internals

3.1.5 cl-syslog/rfc5424.lisp

Source

cl-syslog.asd.

Parent Component

cl-syslog (system).

Public Interface
Internals

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

3.1.6 cl-syslog/rfc5424-reserved.lisp

Source

cl-syslog.asd.

Parent Component

cl-syslog (system).

Internals

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.

Nickname

syslog

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


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

5.1 Public Interface


Next: , Previous: , Up: Public Interface   [Contents][Index]

5.1.1 Constants

Constant: +log-cons+

Log on the console if errors in sending.

Package

cl-syslog.

Source

variable.lisp.

Constant: +log-ndelay+

Don’t delay open.

Package

cl-syslog.

Source

variable.lisp.

Constant: +log-nowait+

Don’t wait for console forks: deprecated.

Package

cl-syslog.

Source

variable.lisp.

Constant: +log-odelay+

Delay open until first syslog() (default).

Package

cl-syslog.

Source

variable.lisp.

Constant: +log-perror+

Log to stderr as well.

Package

cl-syslog.

Source

variable.lisp.

Constant: +log-pid+

Log the pid with each message.

Package

cl-syslog.

Source

variable.lisp.


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.

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.

Macro: syslog (priority format &rest varargs0)
Package

cl-syslog.

Source

cl-syslog.lisp.


5.1.3 Ordinary functions

Function: closelog ()
Package

cl-syslog.

Source

cl-syslog.lisp.

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.

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.

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.

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.

Function: null-log-writer ()

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

Package

cl-syslog.

Source

rfc5424.lisp.

Function: openlog (ident option facility)
Package

cl-syslog.

Source

cl-syslog.lisp.

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.

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.

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.

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.


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.

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.

Methods
Method: format-log ((logger rfc5424-logger) priority control &rest args)

5.1.5 Standalone methods

Method: shared-initialize :around ((logger rfc5424-logger) slot-names &key facility maximum-priority hostname app-name process-id log-writer &allow-other-keys)
Source

rfc5424.lisp.


5.1.6 Conditions

Condition: invalid-facility
Package

cl-syslog.

Source

cl-syslog.lisp.

Direct superclasses

error.

Direct methods

facility.

Direct slots
Slot: facility
Initargs

:facility

Readers

facility.

Writers

This slot is read-only.

Condition: invalid-priority
Package

cl-syslog.

Source

cl-syslog.lisp.

Direct superclasses

error.

Direct methods

priority.

Direct slots
Slot: priority
Initargs

:priority

Readers

priority.

Writers

This slot is read-only.

Condition: malformed-rfc5424-input
Package

cl-syslog.

Source

rfc5424.lisp.

Direct superclasses

error.

Direct methods

violated-assertion.

Direct slots
Slot: violated-assertion
Initargs

:violated-assertion

Readers

violated-assertion.

Writers

This slot is read-only.


Previous: , Up: Public Interface   [Contents][Index]

5.1.7 Classes

Class: rfc5424-logger

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

Package

cl-syslog.

Source

rfc5424.lisp.

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

The syslog facility, as a keyword.

Initargs

:facility

Readers

logger-facility.

Writers

This slot is read-only.

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.

Writers

This slot is read-only.

Slot: hostname
Initargs

:hostname

Readers

logger-hostname.

Writers

This slot is read-only.

Slot: app-name
Initargs

:app-name

Readers

logger-app-name.

Writers

This slot is read-only.

Slot: process-id
Initargs

:process-id

Readers

logger-process-id.

Writers

This slot is read-only.

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.

Writers

This slot is read-only.


5.2 Internals


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

5.2.1 Constants

Constant: nilvalue

The RFC 5424 "NILVALUE".

Package

cl-syslog.

Source

rfc5424.lisp.


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

5.2.2 Special variables

Special Variable: *facilities*
Package

cl-syslog.

Source

variable.lisp.

Special Variable: *priorities*
Package

cl-syslog.

Source

variable.lisp.


5.2.3 Macros

Macro: assert-rfc5424 (thing)
Package

cl-syslog.

Source

rfc5424.lisp.


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

5.2.4 Ordinary functions

Function: ascii-char-p (c)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: ascii-control-char-p (c)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: ascii-graphic-char-p (c)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: ascii-graphic-string-p (x)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: ascii-whitespace-char-p (c)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: copy-structured-data-description (instance)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: copy-structured-data-field-description (instance)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: find-sd-id (name)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: (setf find-sd-id) (name)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: ip-address-p (x)
Package

cl-syslog.

Source

rfc5424-reserved.lisp.

Function: ip4-address-p (x)
Package

cl-syslog.

Source

rfc5424-reserved.lisp.

Function: ip6-address-p (x)
Package

cl-syslog.

Source

rfc5424-reserved.lisp.

Function: make-param (name value)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: make-sd-element (id &rest params)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: make-structured-data-description (&key id allow-other-params fields)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: make-structured-data-field-description (&key name repetitions-allowed-p length-type validator)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: param-name (param)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: param-value (param)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: sd-element-id (elt)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: sd-element-params (elt)
Package

cl-syslog.

Source

rfc5424.lisp.

Reader: structured-data-description-allow-other-params (instance)
Package

cl-syslog.

Source

rfc5424.lisp.

Target Slot

allow-other-params.

Reader: structured-data-description-fields (instance)
Package

cl-syslog.

Source

rfc5424.lisp.

Target Slot

fields.

Reader: structured-data-description-id (instance)
Package

cl-syslog.

Source

rfc5424.lisp.

Target Slot

id.

Function: structured-data-description-p (object)
Package

cl-syslog.

Source

rfc5424.lisp.

Reader: structured-data-field-description-length-type (instance)
Package

cl-syslog.

Source

rfc5424.lisp.

Target Slot

length-type.

Reader: structured-data-field-description-name (instance)
Package

cl-syslog.

Source

rfc5424.lisp.

Target Slot

name.

Function: structured-data-field-description-p (object)
Package

cl-syslog.

Source

rfc5424.lisp.

Reader: structured-data-field-description-repetitions-allowed-p (instance)
Package

cl-syslog.

Source

rfc5424.lisp.

Target Slot

repetitions-allowed-p.

Reader: structured-data-field-description-validator (instance)
Package

cl-syslog.

Source

rfc5424.lisp.

Target Slot

validator.

Function: valid-app-name-p (thing)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: valid-day-p (x)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: valid-enterprise-number-p (string)

Is the string STRING a valid enterprise number?

Package

cl-syslog.

Source

rfc5424.lisp.

Function: valid-fraction-of-a-second-p (x)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: valid-hostname-p (thing)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: valid-hour-p (x)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: valid-minute-p (x)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: valid-month-p (x)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: valid-msgid-p (thing)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: valid-param-p (p)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: valid-pri-p (thing)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: valid-procid-p (thing)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: valid-sd-element-p (e)
Package

cl-syslog.

Source

rfc5424.lisp.

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.

Function: valid-sd-name-p (string)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: valid-second-p (x)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: valid-year-p (x)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: write-app-name (stream app-name)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: write-date (stream year month day)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: write-hostname (stream hostname)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: write-msg (stream string)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: write-msgid (stream msgid)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: write-param-name (stream string)

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

Package

cl-syslog.

Source

rfc5424.lisp.

Function: write-param-value (stream string)

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

Package

cl-syslog.

Source

rfc5424.lisp.

Function: write-pri (stream pri)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: write-procid (stream procid)
Package

cl-syslog.

Source

rfc5424.lisp.

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.

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.

Function: write-sd-element (stream elt)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: write-sd-elements (stream elts)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: write-time (stream hour minute second fraction-of-a-second)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: write-two-digit-number (stream number)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: write-utc-timestamp (stream year month day hour minute second fraction-of-a-second)
Package

cl-syslog.

Source

rfc5424.lisp.

Function: write-version (stream)
Package

cl-syslog.

Source

rfc5424.lisp.


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

5.2.5 Generic functions

Generic Reader: facility (condition)
Package

cl-syslog.

Methods
Reader Method: facility ((condition invalid-facility))
Source

cl-syslog.lisp.

Target Slot

facility.

Generic Reader: logger-app-name (object)
Package

cl-syslog.

Methods
Reader Method: logger-app-name ((rfc5424-logger rfc5424-logger))

automatically generated reader method

Source

rfc5424.lisp.

Target Slot

app-name.

Generic Reader: logger-facility (object)
Package

cl-syslog.

Methods
Reader Method: logger-facility ((rfc5424-logger rfc5424-logger))

The syslog facility, as a keyword.

Source

rfc5424.lisp.

Target Slot

facility.

Generic Reader: logger-hostname (object)
Package

cl-syslog.

Methods
Reader Method: logger-hostname ((rfc5424-logger rfc5424-logger))

automatically generated reader method

Source

rfc5424.lisp.

Target Slot

hostname.

Generic Reader: logger-log-writer (object)
Package

cl-syslog.

Methods
Reader 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.

Target Slot

log-writer.

Generic Reader: logger-maximum-priority (object)
Package

cl-syslog.

Methods
Reader 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.

Target Slot

maximum-priority.

Generic Reader: logger-process-id (object)
Package

cl-syslog.

Methods
Reader Method: logger-process-id ((rfc5424-logger rfc5424-logger))

automatically generated reader method

Source

rfc5424.lisp.

Target Slot

process-id.

Generic Reader: priority (condition)
Package

cl-syslog.

Methods
Reader Method: priority ((condition invalid-priority))
Source

cl-syslog.lisp.

Target Slot

priority.

Generic Reader: violated-assertion (condition)
Package

cl-syslog.

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

rfc5424.lisp.

Target Slot

violated-assertion.


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

5.2.6 Structures

Structure: structured-data-description

A description of structured data.

Package

cl-syslog.

Source

rfc5424.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: id
Type

alexandria:string-designator

Readers

structured-data-description-id.

Writers

This slot is read-only.

Slot: allow-other-params
Type

boolean

Initform

t

Readers

structured-data-description-allow-other-params.

Writers

This slot is read-only.

Slot: fields
Type

alexandria:proper-list

Readers

structured-data-description-fields.

Writers

This slot is read-only.

Structure: structured-data-field-description

A description of a field of structured data.

Package

cl-syslog.

Source

rfc5424.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: name
Type

alexandria:string-designator

Readers

structured-data-field-description-name.

Writers

This slot is read-only.

Slot: repetitions-allowed-p
Type

boolean

Readers

structured-data-field-description-repetitions-allowed-p.

Writers

This slot is read-only.

Slot: length-type
Initform

(quote unsigned-byte)

Readers

structured-data-field-description-length-type.

Writers

This slot is read-only.

Slot: validator
Type

(or symbol function)

Initform

(constantly t)

Readers

structured-data-field-description-validator.

Writers

This slot is read-only.


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

5.2.7 Types

Type: rfc5424-pri ()
Package

cl-syslog.

Source

rfc5424.lisp.


Appendix A Indexes


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

A.1 Concepts


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): Private ordinary functions

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

C
closelog: Public ordinary functions
copy-structured-data-description: Private ordinary functions
copy-structured-data-field-description: Private ordinary functions
current-time: Public generic functions
current-time: Public generic functions

D
define-structured-data-id: Public macros

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

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

I
ip-address-p: Private ordinary functions
ip4-address-p: Private ordinary functions
ip6-address-p: Private ordinary functions

J
join-log-writers: Public ordinary functions

L
log: Public ordinary functions
logger-app-name: Private generic functions
logger-app-name: Private generic functions
logger-facility: Private generic functions
logger-facility: Private generic functions
logger-hostname: Private generic functions
logger-hostname: Private generic functions
logger-log-writer: Private generic functions
logger-log-writer: Private generic functions
logger-maximum-priority: Private generic functions
logger-maximum-priority: Private generic functions
logger-process-id: Private generic functions
logger-process-id: Private generic functions

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

N
null-log-writer: Public ordinary functions

O
openlog: Public ordinary functions

P
param-name: Private ordinary functions
param-value: Private ordinary functions
priority: Private generic functions
priority: Private generic functions

R
rfc-log: Public macros

S
sd-element-id: Private ordinary functions
sd-element-params: Private ordinary functions
shared-initialize: Public standalone methods
stream-log-writer: Public ordinary functions
structured-data-description-allow-other-params: Private ordinary functions
structured-data-description-fields: Private ordinary functions
structured-data-description-id: Private ordinary functions
structured-data-description-p: Private ordinary functions
structured-data-field-description-length-type: Private ordinary functions
structured-data-field-description-name: Private ordinary functions
structured-data-field-description-p: Private ordinary functions
structured-data-field-description-repetitions-allowed-p: Private ordinary functions
structured-data-field-description-validator: Private ordinary functions
syslog: Public macros
syslog-log-writer: Public ordinary functions

T
tee-to-stream: Public ordinary functions

U
udp-log-writer: Public ordinary functions

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

W
write-app-name: Private ordinary functions
write-date: Private ordinary functions
write-hostname: Private ordinary functions
write-msg: Private ordinary functions
write-msgid: Private ordinary functions
write-param-name: Private ordinary functions
write-param-value: Private ordinary functions
write-pri: Private ordinary functions
write-procid: Private ordinary functions
write-rfc5424-syslog-message: Private ordinary functions
write-rfc5424-syslog-message-unsafe: Private ordinary functions
write-sd-element: Private ordinary functions
write-sd-elements: Private ordinary functions
write-time: Private ordinary functions
write-two-digit-number: Private ordinary functions
write-utc-timestamp: Private ordinary functions
write-version: Private ordinary 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*: Private special variables
*priorities*: Private special variables

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

A
allow-other-params: Private structures
app-name: Public classes

C
Constant, +log-cons+: Public constants
Constant, +log-ndelay+: Public constants
Constant, +log-nowait+: Public constants
Constant, +log-odelay+: Public constants
Constant, +log-perror+: Public constants
Constant, +log-pid+: Public constants
Constant, nilvalue: Private constants

F
facility: Public conditions
facility: Public classes
fields: Private structures

H
hostname: Public classes

I
id: Private structures

L
length-type: Private structures
log-writer: Public classes

M
maximum-priority: Public classes

N
name: Private structures
nilvalue: Private constants

P
priority: Public conditions
process-id: Public classes

R
repetitions-allowed-p: Private structures

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

V
validator: Private structures
violated-assertion: Public 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   F   I   M   P   R   S   T   V  
Index Entry  Section

C
cl-syslog: The cl-syslog system
cl-syslog: The cl-syslog package
cl-syslog.asd: The cl-syslog/cl-syslog․asd file
cl-syslog.lisp: The cl-syslog/cl-syslog․lisp file
Class, rfc5424-logger: Public classes
Condition, invalid-facility: Public conditions
Condition, invalid-priority: Public conditions
Condition, malformed-rfc5424-input: Public conditions

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

I
invalid-facility: Public conditions
invalid-priority: Public conditions

M
malformed-rfc5424-input: Public conditions

P
Package, cl-syslog: The cl-syslog package
package.lisp: The cl-syslog/package․lisp file

R
rfc5424-logger: Public classes
rfc5424-pri: Private types
rfc5424-reserved.lisp: The cl-syslog/rfc5424-reserved․lisp file
rfc5424.lisp: The cl-syslog/rfc5424․lisp file

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

T
Type, rfc5424-pri: Private types

V
variable.lisp: The cl-syslog/variable․lisp file

Jump to:   C   F   I   M   P   R   S   T   V