You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/logging.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,8 @@
1
1
# Logging
2
2
3
+
> [!TIP]
4
+
> Logging is one part of FrankenPHP's observability story. See the [Observability](observability.md) page for the full picture, including real-time monitoring and metrics.
5
+
3
6
FrankenPHP integrates seamlessly with [Caddy's logging system](https://caddyserver.com/docs/logging).
4
7
You can log messages using standard PHP functions or leverage the dedicated `frankenphp_log()` function for advanced
FrankenPHP provides built-in observability features: [Prometheus-compatible metrics](metrics.md) and [structured logging](logging.md).
4
+
These features, combined with the recommended tools below, give you full visibility into your PHP application's behavior in development and production.
5
+
6
+
## Ember TUI and Prometheus Exporter
7
+
8
+
[Ember](https://github.com/alexandre-daubois/ember) is the most user-friendly way to monitor FrankenPHP.
9
+
10
+
It connects to Caddy's admin API and deeply integrates with FrankenPHP, providing real-time visibility with zero configuration and no external infrastructure.
11
+
12
+
It is designed to be used in development and production, with a TUI dashboard for local use and a Prometheus export daemon mode for production monitoring.
13
+
14
+
> [!TIP]
15
+
> See the [Ember documentation](https://github.com/alexandre-daubois/ember) for the full list of features and setup details.
16
+
17
+
## Metrics
18
+
19
+
FrankenPHP exposes Prometheus-compatible metrics for threads, workers, request processing, and queue depth when [Caddy metrics](https://caddyserver.com/docs/metrics) are enabled.
20
+
21
+
See the [Metrics](metrics.md) page for the full list of available metrics.
22
+
23
+
## Logging
24
+
25
+
FrankenPHP integrates with Caddy's logging system and provides `frankenphp_log()` for structured logging with severity levels and context data, making ingestion into platforms like Datadog, Grafana Loki, or Elastic straightforward.
26
+
27
+
See the [Logging](logging.md) page for usage details.
28
+
29
+
## Custom Prometheus/Grafana Setup
30
+
31
+
If you prefer a custom monitoring stack, you can scrape FrankenPHP metrics directly.
32
+
There are two options:
33
+
34
+
1.**Scrape Caddy directly**: Caddy exposes metrics at its admin endpoint (default: `localhost:2019/metrics`)
35
+
2.**Scrape via Ember**: when running Ember with `--expose`, it exposes FrankenPHP metrics along with computed metrics derived from Caddy data (RPS, latency percentiles, error rates) on a dedicated endpoint.
0 commit comments