Logs

Logs are an essential part of an application, and they come natively in Bear Framework. You can configure automatic error logging and log custom data yourself. The build-in file logger is a great way to enable logging and store logs as files at a directory specified.

use BearFramework\App;

$app App::get();

// Enables a file based storage for the logs.
$app->logs->useFileLogger('/logs/storage/path/');

// Log something.
$app->logs->log('info''Visit from 111.222.333.444');

Automatic error logging

You can enable automatic error logging too.

use BearFramework\App;

$app App::get();

// Enables error logging.
$app->enableErrorHandler(['logErrors' => true]);

Learn more

Handle HTTP requests
Store and retrieve data

The information on this page is created for version 1.1 of Bear Framework and may not be applicable for other versions of the framework.