datitisev Good question!
We're not using the full Laravel framework, but only parts of it. So, for example, the global Log
facade is not available. What you can do instead is this:
app('log')->debug('some logging message');
The app()
method can be used to retrieve objects from the IoC container, which holds references to certain objects (or information on how to construct them). So, in this case, app('log')
will return an implementation of Laravel's Illuminate\Contracts\Logging\Log
interface. We have configured the container to return a properly configured instance here.
Now that you have access to the logger, you can call any of the interface's methods to write messages with various log levels to the logger - which is normally just a logfile, but could be adapted to any kind of log service / database. But your code does not have to care about that.
P.S.: We may consider adding a shortcut for logging in the future, but really, to me this is short enough.