Caddy error logs

Caddy is a powerful, enterprise-ready, open-source web server with automatic HTTPS written in Go. When the normal HTTP request handlers return an error, it will be logged into the error logs file instantly. Site24x7 AppLogs natively supports Caddy error logs.

Getting started

1. Log in to your Site24x7 account.
2. Download and install the Site24x7 Server Monitoring agent (Windows | Linux).
3. Go to Admin > AppLogs > Log Profile and select Add Log Profile.
4. Enter the Profile Name.
5. Select Caddy Access Logs from the Choose the Log Type drop-down.

  • The Pattern and Sample Logs are displayed below.
    Sample Logs:
    25/May/2021:21:17:46 -0700 [ERROR 502 /] unreachable backend
    25/May/2021:21:17:46 -0700 [ERROR 502 /favicon.ico] unreachable backend
    25/May/2021:21:24:11 -0700 [ERROR 502 /] unreachable backend
    This log is separated into fields, each of which takes its respective value and is then uploaded to Site24x7.
  • By default, this is the Log Pattern identified by Site24x7 AppLogs for Caddy error logs:
    $Datetime:date$ [$LogLevel$ $Status:number$ $Path$] $Message$
  • You can also add custom Log Pattern instead of the default one. To do so, click the pencil icon and specify your pattern.
    caddy-error-log-type

6. Select the Local File as the Log Source.

7. By default, the paths below are used as the file sources:
Linux: /opt/caddy/logs/*error.log, /home/jitpack/caddy/logs/*error.log
Windows: C:\caddy\logs\*error.log

  • If your source path is different from the default path, specify it in the List of files to search for logs field.

8. Select either monitors or monitor groups to collect the logs.
caddy-error-logs-profile

9. Click Save.

Dashboard

AppLogs creates an exclusive dashboard for every Log Type and shows a few widgets by default. Here's a list of the widgets available in the Caddy error log dashboard:

  • Logging Levels
  • Status Codes
  • Top Failed Requests

 caddy error logs dashboard

Related log types

 

Was this document helpful?
Thanks for taking the time to share your feedback. We’ll use your feedback to improve our online help resources.