APPNETOS is under active development This website and its documentation are being prepared for public launch. Content and features may change.
Select Theme
Loading

Diagnostics & Lifecycle

Understand every request. Control every exit.

From the first bootstrap instruction to the final shutdown callback, APPNETOS provides the visibility and safeguards needed to diagnose problems, preserve operational records and terminate processes in a controlled way.

Runtime visibility

See what your application actually does.

When debug mode is enabled in the relevant environment configuration or override, APPNETOS exposes technical exceptions and provides a browser DebugBar. Its collectors show request parameters, logged messages, dumps, exception details, MongoDB and Redis queries with individual execution times, connection status, aggregate query times, rendered Twig templates with time and memory usage, peak memory consumption and the PHP version.

AJAX calls can be inspected separately, allowing developers to switch between the diagnostics of individual asynchronous requests. The runtime also makes the active debug state conspicuous in the console.

A closer look at each request

MongoDB & Redis

Connection status, timings and query lists

Twig

Templates, rendering time and memory

Exceptions & Logs

Errors and events from the request

AJAX

Independent diagnostics for each call

Operational history

Keep a record, even when debugging is off.

Core\Log writes application- and context-specific log files under APPNETOS_VAR/log/<application>/<context>.log. Developers can also choose named log files for individual workflows, such as deployments or monitoring.

Messages may be informational, warnings, errors, critical events or custom types. During debug-enabled requests, the same entries can also appear in the DebugBar. Persistent logging itself does not require debug mode.

Default log organization

APPNETOS_VAR/
└── log/
    └── <application>/
        ├── <context>.log
        └── deployment.log

The named file is an illustrative example of a custom log destination.

Controlled completion

Give every process a clean finish.

APPNETOS lets components register methods that run during the centralized shutdown process. Use the #[Shutdown] annotation for declarative registration or Core\Shutdown for explicit registration. Shutdown tasks can be ordered by priority and are isolated so a failing callback does not prevent subsequent callbacks from being attempted.

Classes extending the APPNETOS developer convenience base can initiate a controlled shutdown through $this->exit(). Response handling can also initiate the shutdown after sending the HTTP response. This is distinct from the PHP fatal-error shutdown handler used by exception processing.

Register

Annotation or Core service

Run application

Request, command or worker

Execute callbacks

Priority and error isolation

Terminate

Controlled process completion

Failure protection

Handle errors even when the application cannot.

An independent early bootstrap error handler protects initialization before the regular Core services are ready. After Core initialization, the central exception handler takes ownership of PHP errors, uncaught exceptions and fatal shutdown errors.

APPNETOS exceptions carry structured context, previous exceptions and safe public messages. The central handler logs errors, forwards them to debugging when available, maps known exception types to HTTP status codes and selects a standalone HTML error page or an application/problem+json response for recognized JSON requests.

Production output avoids exposing internal exception details. If the normal error response path fails, a minimal native fallback remains available.

Layered error protection

1. Early bootstrap
Independent logging and minimal error output
↓ Core handover
2. Core exception handler
Logging, classification and response selection
↓ If normal handling fails
3. Native fallback
Minimal response without normal runtime services

Designed for development. Safe by default in production.

Production debugging requires cleanup

Enabling debug mode publishes DebugBar resources under ./public/src/appnetos-debugbar. After temporary debugging on a production system, disable debug mode in the environment configuration and remove those published resources. Debug views can expose sensitive request data, file paths and internal application details.

Use persistent logging for normal operations, keep public exception messages safe, avoid secrets in logs and exception context, and reserve detailed DebugBar inspection for controlled diagnostic sessions.

Next Steps

Debug

Inspect requests, collectors, AJAX calls and execution metrics.

Explore Debug

Log

Record application events and operational failures.

Explore Log

Shutdown

Register and execute end-of-process callbacks.

Explore Shutdown

Exception

Understand exception handling and native fallbacks.

Explore Exception