The graylog Reference Manual

Table of Contents

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

The graylog Reference Manual

This is the graylog Reference Manual, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:09:46 2018 GMT+0.


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

1 Introduction

CL-GRAYLOG

Graylog Common Lisp client

https://www.graylog.org/

Install

Install graylog server. For easy setup, you can use docker:

$ docker pull graylog2/allinone
$ docker run -t -p 9000:9000 -p 12201:12201 graylog2/allinone

Load the library:

(ql:quickload :graylog)

Usage

(graylog:connect-graylog-toplevel)
(graylog:graylog "hello world")

Log5

The library comes with a Log5 sender so you can simply use Log5 to log to Graylog

(ql:quickload :graylog-log5)

(log5:defcategory app)

(log5:start-sender 'app
        (graylog/log5:graylog-sender)
        :category-spec '(app log5:info+)
        :output-spec '(log5:time log5:category log5:message))

(log5:log-for app "Hello from log5")

Functions

connect-graylog

(&key (host "localhost") (port *default-gelf-port*)
 (hostname *default-host-name*))

Connect to a graylog instance

HOSTNAME: According to GELF spec, it can be the name of the host, source or application that sent this message

connect-graylog-toplevel

(&rest args)

Connect to graylog and set the global connection

graylog

(message &rest args &key (level 1) backtrace host
 (connection (graylog-connection)))

Log to graylog using GELF

https://www.graylog.org/resources/gelf/

Version 1.1 (11/2013) A GELF message is a GZIP’d or ZLIB’d JSON string with the following fields:

version string (UTF-8)

GELF spec version – “1.1”; MUST be set by client library.

host string (UTF-8)

the name of the host, source or application that sent this message; MUST be set by client library.

short_message string (UTF-8)

a short descriptive message; MUST be set by client library.

full_message string (UTF-8)

a long message that can i.e. contain a backtrace; optional.

timestamp number

Seconds since UNIX epoch with optional decimal places for milliseconds; SHOULD be set by client library. Will be set to NOW by server if absent.

level number

the level equal to the standard syslog levels; optional, default is 1 (ALERT).

facility string (UTF-8)

optional, deprecated. Send as additional field instead.

line number

the line in a file that caused the error (decimal); optional, deprecated. Send as additional field instead.

file string (UTF-8)

the file (with path if you want) that caused the error (string); optional, deprecated. Send as additional field instead.

_[additional field] string (UTF-8) or number

every field you send and prefix with a _ (underscore) will be treated as an additional field. Allowed characters in field names are any word character (letter, number, underscore), dashes and dots. The verifying regular expression is: ^[w.-]*$

Libraries SHOULD not allow to send id as additional field (_id). Graylog server nodes omit this field automatically.

graylog-connection

(&key (error-p t))

Return the current graylog connection

Macros

with-graylog-connection

((&key (host) (port)) &body body)

Run body within the scope of a graylog


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 graylog

Author

Mariano Montone <marianomontone@gmail.com>

License

MIT

Description

Graylog Lisp client

Dependencies
Source

graylog.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 graylog.asd

Location

graylog.asd

Systems

graylog (system)


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

3.1.2 graylog/package.lisp

Parent

graylog (system)

Location

package.lisp

Packages

graylog


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

3.1.3 graylog/graylog.lisp

Dependency

package.lisp (file)

Parent

graylog (system)

Location

graylog.lisp

Exported Definitions
Internal Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 graylog

Source

package.lisp (file)

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 Macros

Macro: with-graylog-connection (&key HOST PORT) &body BODY

Run body within the scope of a graylog connection

Package

graylog

Source

graylog.lisp (file)


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

5.1.2 Functions

Function: connect-graylog &key HOST PORT HOSTNAME

Connect to a graylog instance

HOSTNAME: According to GELF spec, it can be the name of the host, source or application that sent this message

Package

graylog

Source

graylog.lisp (file)

Function: connect-graylog-toplevel &rest ARGS

Connect to graylog and set the global connection

Package

graylog

Source

graylog.lisp (file)

Function: graylog MESSAGE &rest ARGS &key LEVEL BACKTRACE HOST CONNECTION &allow-other-keys

Log to graylog using GELF

https://www.graylog.org/resources/gelf/

Version 1.1 (11/2013)
A GELF message is a GZIP’d or ZLIB’d JSON string with the following fields:

version string (UTF-8)

GELF spec version – “1.1”; MUST be set by client library.

host string (UTF-8)

the name of the host, source or application that sent this message; MUST be set by client library.

short_message string (UTF-8)

a short descriptive message; MUST be set by client library.

full_message string (UTF-8)

a long message that can i.e. contain a backtrace; optional.

timestamp number

Seconds since UNIX epoch with optional decimal places for milliseconds; SHOULD be set by client library. Will be set to NOW by server if absent.

level number

the level equal to the standard syslog levels; optional, default is 1 (ALERT).

facility string (UTF-8)

optional, deprecated. Send as additional field instead.

line number

the line in a file that caused the error (decimal); optional, deprecated. Send as additional field instead.

file string (UTF-8)

the file (with path if you want) that caused the error (string); optional, deprecated. Send as additional field instead.

_[additional field] string (UTF-8) or number

every field you send and prefix with a _ (underscore) will be treated as an additional field. Allowed characters in field names are any word character (letter, number, underscore), dashes and dots. The verifying regular expression is: ^[w.-]*$

Libraries SHOULD not allow to send id as additional field (_id). Graylog server nodes omit this field automatically.

Package

graylog

Source

graylog.lisp (file)

Function: graylog-connection &key ERROR-P

Return the current graylog connection

Package

graylog

Source

graylog.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Special variables

Special Variable: *default-gelf-port*
Package

graylog

Source

graylog.lisp (file)

Special Variable: *default-host-name*
Package

graylog

Source

graylog.lisp (file)

Special Variable: *graylog-connection*
Package

graylog

Source

graylog.lisp (file)


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

5.2.2 Functions

Function: call-with-graylog-connection FUNCTION &key HOST PORT HOSTNAME
Package

graylog

Source

graylog.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   G   L  
Index Entry  Section

F
File, Lisp, graylog.asd: The graylog<dot>asd file
File, Lisp, graylog/graylog.lisp: The graylog/graylog<dot>lisp file
File, Lisp, graylog/package.lisp: The graylog/package<dot>lisp file

G
graylog.asd: The graylog<dot>asd file
graylog/graylog.lisp: The graylog/graylog<dot>lisp file
graylog/package.lisp: The graylog/package<dot>lisp file

L
Lisp File, graylog.asd: The graylog<dot>asd file
Lisp File, graylog/graylog.lisp: The graylog/graylog<dot>lisp file
Lisp File, graylog/package.lisp: The graylog/package<dot>lisp file

Jump to:   F   G   L  

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

A.2 Functions

Jump to:   C   F   G   M   W  
Index Entry  Section

C
call-with-graylog-connection: Internal functions
connect-graylog: Exported functions
connect-graylog-toplevel: Exported functions

F
Function, call-with-graylog-connection: Internal functions
Function, connect-graylog: Exported functions
Function, connect-graylog-toplevel: Exported functions
Function, graylog: Exported functions
Function, graylog-connection: Exported functions

G
graylog: Exported functions
graylog-connection: Exported functions

M
Macro, with-graylog-connection: Exported macros

W
with-graylog-connection: Exported macros

Jump to:   C   F   G   M   W  

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

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*default-gelf-port*: Internal special variables
*default-host-name*: Internal special variables
*graylog-connection*: Internal special variables

S
Special Variable, *default-gelf-port*: Internal special variables
Special Variable, *default-host-name*: Internal special variables
Special Variable, *graylog-connection*: Internal special variables

Jump to:   *  
S  

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

A.4 Data types

Jump to:   G   P   S  
Index Entry  Section

G
graylog: The graylog system
graylog: The graylog package

P
Package, graylog: The graylog package

S
System, graylog: The graylog system

Jump to:   G   P   S