# Module syslog_socket

- Description
- Data Types
- Function Index
- Function Details

### Erlang syslog Client Interface

A minimal syslog client interface that supports both RFC3164 and RFC5424.

Copyright © 2016-2018 Michael Truog

Version: 1.7.3 Nov 28 2019 11:38:14 ------------------------------------------------------------------------

Behaviours: `gen_server`.

Authors: Michael Truog (`mjtruog at protonmail dot com`).

## Description

### Erlang syslog Client Interface

A minimal syslog client interface that supports both RFC3164 and RFC5424.

## Data Types

### app_name()

`app_name() = nonempty_string()`

### facility()

`facility() = kernel | user | mail | daemon | auth0 | syslog | print | news | uucp | clock0 | auth1 | ftp | ntp | auth2 | auth3 | clock1 | local0 | local1 | local2 | local3 | local4 | local5 | local6 | local7 | non_neg_integer() | auth | authpriv | cron | kern | lpr | security`

### message_id()

`message_id() = string() | binary()`

### options()

`options() = [{transport, transport()} | {transport_options, list()} | {protocol, protocol()} | {utf8, boolean()} | {facility, facility()} | {app_name, app_name()} | {path, nonempty_string()} | {host, inet:ip_address() | inet:hostname()} | {port, undefined | inet:port_number()} | {timeout, timeout_milliseconds()}]`

### protocol()

`protocol() = rfc3164 | rfc5424`

### severity()

`severity() = emergency | alert | critical | error | warning | notice | informational | debug | 0..7 | emerg | panic | crit | err | warn | info`

### timeout_milliseconds()

`timeout_milliseconds() = 1..4294967295`

### transport()

`transport() = local | udp | tcp | tls`

## Function Index

code_change/3 |
facility/1 | #### Get the syslog facility numerical value. .
facility_valid/1 | #### Test the validity of a syslog facility value. .
handle_call/3 |
handle_cast/2 |
handle_info/2 |
init/1 |
send/3 | #### Send data to syslog without a timestamp or message_id. .
send/4 | #### Send data to syslog without a message_id. .
send/5 | #### Send data to syslog. .
severity/1 | #### Get the syslog severity numerical value. .
severity_valid/1 | #### Test the validity of a syslog severity value. .
start_link/1 | #### Start a syslog socket with a link. Connection is immediate within the new Erlang process.
start_monitor/1 | #### Start a syslog socket with a monitor. Connection is immediate within the new Erlang process.
stop_link/1 | #### Stop an existing syslog socket link asynchronously. .
stop_link/2 | #### Stop an existing syslog socket link synchronously. .
stop_monitor/1 | #### Stop an existing syslog socket monitor asynchronously. The parent process will still receive {'DOWN', _, process, Pid, Info}.
stop_monitor/2 | #### Stop an existing syslog socket monitor synchronously. .
terminate/2 |

## Function Details

### code_change/3

`code_change(X1, State, X3) -> any()`

### facility/1

`facility(Facility::facility()) -> non_neg_integer()`

#### Get the syslog facility numerical value.

### facility_valid/1

`facility_valid(Facility::facility()) -> boolean()`

#### Test the validity of a syslog facility value.

### handle_call/3

`handle_call(Request, X2, State) -> any()`

### handle_cast/2

`handle_cast(Request, State) -> any()`

### handle_info/2

`handle_info(Request, State) -> any()`

### init/1

`init(X1) -> any()`

### send/3

`send(Pid::pid(), Severity::severity(), Data::iodata()) -> ok`

#### Send data to syslog without a timestamp or message_id.

### send/4

`send(Pid::pid(), Severity::severity(), Timestamp::undefined | erlang:timestamp(), Data::iodata()) -> ok`

#### Send data to syslog without a message_id.

### send/5

`send(Pid::pid(), Severity::severity(), Timestamp::undefined | erlang:timestamp(), MessageId::message_id(), Data::iodata()) -> ok`

#### Send data to syslog.

### severity/1

`severity(Severity::severity()) -> 0..7`

#### Get the syslog severity numerical value.

### severity_valid/1

`severity_valid(Severity::severity()) -> boolean()`

#### Test the validity of a syslog severity value.

### start_link/1

`start_link(Options::options()) -> {ok, pid()} | {error, any()}`

#### Start a syslog socket with a link.

Connection is immediate within the new Erlang process.

### start_monitor/1

`start_monitor(Options::options()) -> {ok, pid()} | {error, any()}`

#### Start a syslog socket with a monitor.

Connection is immediate within the new Erlang process.

### stop_link/1

`stop_link(Pid::pid()) -> ok`

#### Stop an existing syslog socket link asynchronously.

### stop_link/2

`stop_link(Pid::pid(), Timeout::timeout_milliseconds()) -> ok`

#### Stop an existing syslog socket link synchronously.

### stop_monitor/1

`stop_monitor(Pid::pid()) -> ok`

#### Stop an existing syslog socket monitor asynchronously.

The parent process will still receive {'DOWN', _, process, Pid, Info}.

### stop_monitor/2

`stop_monitor(Pid::pid(), Timeout::timeout_milliseconds()) -> ok`

#### Stop an existing syslog socket monitor synchronously.

### terminate/2

`terminate(X1, State) -> any()`

Generated by EDoc