feat(config): add log sink support

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso
2025-11-19 16:47:36 -05:00
parent d55979250f
commit b654d4d709
14 changed files with 336 additions and 16 deletions
+8
View File
@@ -332,6 +332,7 @@ type fileConfig struct {
Thresholds []Threshold `json:"thresholds"`
StatusCodes StatusCodes `json:"status_codes"`
DNSBL bool `json:"dnsbl"`
Logging *Logging `json:"logging"`
}
func (c *fileConfig) Valid() error {
@@ -363,6 +364,10 @@ func (c *fileConfig) Valid() error {
}
}
if err := c.Logging.Valid(); err != nil {
errs = append(errs, err)
}
if c.Store != nil {
if err := c.Store.Valid(); err != nil {
errs = append(errs, err)
@@ -385,6 +390,7 @@ func Load(fin io.Reader, fname string) (*Config, error) {
Store: &Store{
Backend: "memory",
},
Logging: (Logging{}).Default(),
}
if err := yaml.NewYAMLToJSONDecoder(fin).Decode(&c); err != nil {
@@ -404,6 +410,7 @@ func Load(fin io.Reader, fname string) (*Config, error) {
},
StatusCodes: c.StatusCodes,
Store: c.Store,
Logging: c.Logging,
}
if c.OpenGraph.TimeToLive != "" {
@@ -469,6 +476,7 @@ type Config struct {
Bots []BotConfig
Thresholds []Threshold
StatusCodes StatusCodes
Logging *Logging
DNSBL bool
}