@bsb/syslog 9.0.0 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +38 -25
  2. package/package.json +7 -4
package/README.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # @bsb/syslog
2
2
 
3
- Syslog server and client for BSB - receive syslog messages and send logs to syslog servers.
3
+ Syslog server and client plugins for BSB. Receive syslog messages from devices and forward BSB logs to syslog servers using UDP, TCP, or TLS.
4
+
5
+ ## Features
6
+
7
+ - Syslog server for UDP and TCP
8
+ - Syslog client (observable) for UDP, TCP, and TLS
9
+ - RFC 3164 and RFC 5424 support
10
+ - Event-driven processing of incoming syslog messages
11
+ - Log level filtering and facility configuration
4
12
 
5
13
  ## Installation
6
14
 
@@ -8,29 +16,15 @@ Syslog server and client for BSB - receive syslog messages and send logs to sysl
8
16
  npm install @bsb/syslog
9
17
  ```
10
18
 
11
- ## Features
12
-
13
- ### Syslog Server
14
- - **Receive syslog messages** - UDP/TCP protocols
15
- - **RFC compliance** - Supports RFC 3164 and RFC 5424
16
- - **Event emission** - Emit received messages as BSB events
17
- - **Client API** - Subscribe to syslog messages from other services
18
-
19
- ### Syslog Client (Observable)
20
- - **Send BSB logs to syslog** - Forward application logs
21
- - **Multiple protocols** - UDP, TCP, TLS support
22
- - **RFC compliance** - RFC 3164 and RFC 5424
23
- - **Level filtering** - Control which log levels are sent
24
-
25
19
  ## Configuration
26
20
 
27
- ### Server Configuration
21
+ ### Syslog Server (Service Plugin)
28
22
 
29
23
  ```yaml
30
24
  plugins:
31
25
  services:
32
26
  - plugin: "@bsb/syslog"
33
- service: "SyslogServerPlugin"
27
+ service: "service-syslog-server"
34
28
  enabled: true
35
29
  config:
36
30
  port: 514
@@ -38,13 +32,13 @@ plugins:
38
32
  exclusive: false
39
33
  ```
40
34
 
41
- ### Client (Observable) Configuration
35
+ ### Syslog Client (Observable Plugin)
42
36
 
43
37
  ```yaml
44
38
  plugins:
45
39
  observables:
46
40
  - plugin: "@bsb/syslog"
47
- observable: "SyslogClientPlugin"
41
+ observable: "observable-syslog"
48
42
  enabled: true
49
43
  config:
50
44
  host: "localhost"
@@ -60,16 +54,35 @@ plugins:
60
54
  error: true
61
55
  ```
62
56
 
57
+ ### Notes
58
+
59
+ - Port 514 is privileged on Unix-like systems. Use a port above 1024 if you cannot run as root.
60
+ - Use `facility` values 16-23 (local0-local7) for custom applications.
61
+
63
62
  ## Usage
64
63
 
64
+ Subscribe to incoming syslog messages with the server client:
65
+
65
66
  ```typescript
66
- import {
67
- SyslogServerPlugin,
68
- SyslogServerClient,
69
- SyslogClientPlugin
70
- } from "@bsb/syslog";
67
+ import { Client as SyslogServerClient } from "@bsb/syslog/lib/plugins/service-syslog-server";
68
+
69
+ const syslogClient = new SyslogServerClient(this);
70
+ await syslogClient.events.onEvent("onMessage", this.obs, async (obs, message) => {
71
+ obs.log.info("Received syslog from {host}", { host: message.host });
72
+ });
71
73
  ```
72
74
 
75
+ ## Documentation
76
+
77
+ - Syslog Server: `https://github.com/BetterCorp/better-service-base/blob/master/plugins/nodejs/syslog/docs/syslog-server.md`
78
+ - Syslog Client: `https://github.com/BetterCorp/better-service-base/blob/master/plugins/nodejs/syslog/docs/syslog-client.md`
79
+ These docs are used by the BSB Registry.
80
+
81
+ ## Links
82
+
83
+ - GitHub: `https://github.com/BetterCorp/better-service-base/tree/master/plugins/nodejs/syslog`
84
+ - BSB Registry (package): `https://io.bsbcode.dev/packages/nodejs/@bsb/syslog`
85
+
73
86
  ## License
74
87
 
75
- Dual-licensed under AGPL-3.0-only OR Commercial License.
88
+ (AGPL-3.0-only OR Commercial)
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@bsb/syslog",
3
- "version": "9.0.0",
3
+ "version": "9.0.1",
4
4
  "license": "(AGPL-3.0-only OR Commercial)",
5
5
  "author": {
6
6
  "name": "BetterCorp (PTY) Ltd",
7
- "email": "nick@bettercorp.dev",
7
+ "email": "ninja@bettercorp.dev",
8
8
  "url": "https://bettercorp.dev/"
9
9
  },
10
10
  "description": "Syslog server and client for BSB - receive syslog messages and send logs to syslog servers",
@@ -55,6 +55,9 @@
55
55
  "node": ">=23.0.0",
56
56
  "npm": ">=11.0.0"
57
57
  },
58
- "homepage": "https://io.bsbcode.dev/plugins/bsb/syslog"
58
+ "homepage": "https://io.bsbcode.dev/packages/nodejs/@bsb/syslog"
59
59
  }
60
-
60
+
61
+
62
+
63
+