Log details in backend

When i using Log::info(‘message’,[…]); additional data may show in backend Event Log viewer, right? On file is all data stored (serialized {"uuid":"495e5a44-dbd3-483b-9c53-8255616bef99"} in json, but never shows in backend.

some timeline to get this in some form of nested table or something?

expected behaviour is, that there may be an another tab like “data” or “contents”

This is used for parsing the message, as opposed to capturing a payload. For example:

Log::info('Showing the user profile for user: {id}', ['id' => $id]);

not sure, but not working

Log::info('Event {type} from stripe. Payment intent ID: {id}', ['id'=> $event->id,'type'=>$event->type]);


tried with double currly brackets, with :type and :id … not working too…

Hmm. It is a Laravel thing. Maybe they removed this…

current laravel docu

use Illuminate\Support\Facades\Log;
Log::info('User {id} failed to login.', ['id' => $user->id]);

FYI: OctoberCMS v2 runs on Laravel 6.x, which doesn’t have this feature.
If you’re not using Log channels and keep a context, you really don’t need to use it like this. Use double quotes and let PHP expand the variables.

fyi, im not using oc 2 but 3.4.14

Version 3 is built on Laravel 9

You can check the version of your Laravel:

php artisan --version

If you’re running Laravel 9, don’t expect the code found in Laravel 10 doc to work:

use Illuminate\Support\Facades\Log;
Log::info('User {id} failed to login.', ['id' => $user->id]);

@apinard Nice catch, didn’t notice that this was introduced in 10.x and not earlier.
@snipi V3.4 supports Laravel 10, so you might just have to update your composer.json. But make sure that upgrading for this minor feature is worth the hassle :wink:

1 Like

ok, that sounds legit… v 9 is not aware about this kind of logging details. thanks