ergochat / ergo

A modern IRC server (daemon/ircd) written in Go.
https://ergo.chat/
MIT License
2.21k stars 176 forks source link

unmarshal errors activating logs #2085

Closed blackheaven closed 10 months ago

blackheaven commented 10 months ago

I am trying to enable debug logs via:

logging:
  level: debug
  method: stderr
  type: '* -internal -server'

However I get:

Sep 10 00:16:43 barracuda systemd[1]: Started Ergo IRC daemon.
Sep 10 00:16:44 barracuda ergo[233083]: 2023/09/10 00:16:44 Config file did not load successfully: yaml: unmarshal errors:
Sep 10 00:16:44 barracuda ergo[233083]:   line 59: cannot unmarshal !!map into []logger.LoggingConfig
Sep 10 00:16:44 barracuda systemd[1]: ergochat.service: Main process exited, code=exited, status=1/FAILURE
Sep 10 00:16:44 barracuda systemd[1]: ergochat.service: Failed with result 'exit-code'.

What is the correct syntax

ghost commented 10 months ago

Does double vs single quotes matter? (I legit don't know, just a thought.)

Edit: I would also test with just "*" just to make sure one of your excludes isn't conflicting or some such.

slingamn commented 10 months ago

logging is a list (we allow multiple logs, each with different configurations, although this feature is not commonly used in practice). Here's the correct syntax (note the - underneath logging):

logging:
    -
        method: stderr
        type: "*"
        level: debug

For debugging, * is recommended (excluding internal and server may omit relevant context). Let me know if you have any further issues.

blackheaven commented 10 months ago

logging is a list (we allow multiple logs, each with different configurations, although this feature is not commonly used in practice). Here's the correct syntax (note the - underneath logging):

That was the error, thanks a lot!