Facades

Lumberjack uses the Blast Facades library.

Creating a Facade

Facades provide a simple static API to an object that has been registered into the container. For example to setup a facade you would first use a Service Provider to register an instance of your class into the container:

namespace Rareloop\Lumberjack\Providers;
use Monolog\Logger;
use Rareloop\Lumberjack\Application;
class LogServiceProvider extends ServiceProvider
{
public function register()
{
// Create object instance and bind into container
$this->app->bind('logger', new Logger('app'));
}
}

Then create a Facade subclass and tell it which key to use to retrieve your class instance:

namespace Rareloop\Lumberjack\Facades;
use Blast\Facades\AbstractFacade;
class Log extends AbstractFacade
{
protected static function accessor()
{
return 'logger';
}
}