Forward logs to specific route

1. The problem I’m having:

I am trying to configure logging to POST logs to localhost:5403/logs/:

log {
                level INFO
                output net localhost:5403/logs/
                format json
        }

I understand why this doesn’t work, since “Caddy network addresses are not URLs.” (Conventions — Caddy Documentation). I wonder if there is some conventional way of handling this use case.

2. Error messages and/or full log output:

Error: loading initial config: loading new config: setting up custom log 'log1': opening log writer using &logging.NetWriter{Address:"localhost:5403/logs/", DialTimeout:0, addr:caddy.NetworkAddress{Network:"localhost:5403", Host:"logs/", StartPort:0x0, EndPort:0x0}}: 
dial localhost:5403: unknown network localhost:5403

3. Caddy version:

v2.6.3

4. How I installed and ran Caddy:

caddy run --config .\Caddyfile

a. System environment:

Windows

The net writer isn’t HTTP, so there’s no such thing as a path. It’s just a raw TCP pipe.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.