trea / caddy-loki-logger

Push logs from your Caddy web server directly to a Loki instance
3 stars 0 forks source link

`caddy.logging.writers.loki` is not a Caddyfile unmarshaler; is `loki.LokiLogger` #1

Closed erri120 closed 1 year ago

erri120 commented 1 year ago

I'm getting the following error:

Error: adapting config using caddyfile: parsing caddyfile tokens for 'log': /etc/caddy/Caddyfile:8 - Error during parsing: module caddy.logging.writers.loki is not a Caddyfile unmarshaler; is loki.LokiLogger

My config:

{
    log default {
        output loki http://loki:3100
    }
}

Using docker.io/caddy:2.7-builder-alpine to build a custom image with this logger enabled.

trea commented 1 year ago

That error should be fixed as of now with release v0.3.0, but you'll also need to be using Go 1.20, and I don't think Caddy's builder image has updated to 1.20 yet.

Let me know if I can help you with this any further.

erri120 commented 1 year ago

Thanks, the issue seems to be fixed now.

Caddy  | {"level":"info","ts":1686127048.4433863,"msg":"redirected default logger","from":"stderr","to":"http://loki:3100"}