I would like to add some data to all the log entries in my Laravel application.
I think it would be useful to know the username of the current user and / or the IP address of the client.
I am currently adding it manually by doing:
Log::info('Pre-paid activation.', array('username' => Auth::user()->username));
But I would like to know how to add an listener or do something so that all log entries have a username (if available).
source
share