mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-14 04:28:49 +00:00
feat(config): add log sink support
Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
2
lib/config/testdata/bad/logging-invalid-sink.yaml
vendored
Normal file
2
lib/config/testdata/bad/logging-invalid-sink.yaml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
logging:
|
||||
sink: "nope"
|
||||
2
lib/config/testdata/bad/logging-no-parameters.yaml
vendored
Normal file
2
lib/config/testdata/bad/logging-no-parameters.yaml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
logging:
|
||||
sink: "file"
|
||||
15
lib/config/testdata/good/logging-file.yaml
vendored
Normal file
15
lib/config/testdata/good/logging-file.yaml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
bots:
|
||||
- name: simple
|
||||
action: CHALLENGE
|
||||
user_agent_regex: Mozilla
|
||||
|
||||
logs:
|
||||
sink: "file"
|
||||
parameters:
|
||||
file: "/var/log/botstopper/default.log"
|
||||
maxBackups: 3 # keep at least 3 old copies
|
||||
maxBytes: 67108864 # each file can have up to 64 MB of logs
|
||||
maxAge: 7 # rotate files out every n days
|
||||
oldFileTimeFormat: 2006-01-02T15-04-05 # RFC 3339-ish
|
||||
compress: true
|
||||
useLocalTime: false # timezone for rotated files is UTC
|
||||
7
lib/config/testdata/good/logging-stdio.yaml
vendored
Normal file
7
lib/config/testdata/good/logging-stdio.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
bots:
|
||||
- name: simple
|
||||
action: CHALLENGE
|
||||
user_agent_regex: Mozilla
|
||||
|
||||
logging:
|
||||
sink: "stdio"
|
||||
Reference in New Issue
Block a user