Skip to content
Extended Laravel Logger
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md
composer.json

README.md

laravel-xlog

Extended Laravel Log Component XLog adds User ID, User IP, Track ID to each log

Installation

composer require tartan/laravel-xlog

Add this to your app service providers :

    Tartan\Log\XLogServiceProvider::class,

Config (optional)

add following keys to your project .env file

# track id key
XLOG_ADD_USERID= (default true)
XLOG_TRACK_ID_KEY= (default xTrackId)

Usage

use Tartan\Log\XLog; // or register XLog Facade

XLog::info('test message');
XLog::notice('test message');
XLog::warning('test message');
XLog::error('test message');
XLog::critical('test message');
XLog::alert('test message');
XLog::emergency('test message');

Pass parameters


// passing string
$string = 'test'
XLog::info('test message', [$string]);

// passing array
$array = [1,2,'test',4.2];
XLog::info('test message', $array);

Log exception

XLog::exception($e, 'error');
You can’t perform that action at this time.