- **`level`**: The severity level of the log. Can be any arbitrary integer. Convenience constants are provided for common levels: `FRANKENPHP_LOG_LEVEL_DEBUG` (`-4`), `FRANKENPHP_LOG_LEVEL_INFO` (`0`), `FRANKENPHP_LOG_LEVEL_WARN` (`4`) and `FRANKENPHP_LOG_LEVEL_ERROR` (`8`)). Default is `FRANKENPHP_LOG_LEVEL_INFO`.
- **`context`**: An associative array of additional data to include in the log entry.
### Example
```php
<?php
// Log a simple informational message
frankenphp_log("Hello from FrankenPHP!");
// Log a warning with context data
frankenphp_log(
"Memory usage high",
FRANKENPHP_LOG_LEVEL_WARN,
[
'current_usage'=>memory_get_usage(),
'peak_usage'=>memory_get_peak_usage(),
],
);
```
When viewing the logs (e.g., via `docker compose logs`), the output will appear as structured JSON:
```json
{"level":"info","ts":1704067200,"logger":"frankenphp","msg":"Hello from FrankenPHP!"}