PHPackages                             tartan/laravel-xlog - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. tartan/laravel-xlog

ActiveLaravel-component[Logging &amp; Monitoring](/categories/logging)

tartan/laravel-xlog
===================

extended Laravel 5+ log

v1.3.2(3y ago)107.5k11MITPHPPHP &gt;=7.0CI failing

Since Jun 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/php-monsters/laravel-extended-logger)[ Packagist](https://packagist.org/packages/tartan/laravel-xlog)[ RSS](/packages/tartan-laravel-xlog/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (16)Used By (1)

laravel-xlog
============

[](#laravel-xlog)

Extended Laravel Log Component XLog adds `User ID`, `User IP`, and `unique Track ID` to each log in a PHP lifecycle. So you can fetch all logs that are submitted through a Laravel request lifecycle (from beginning to end).

You can fetch all logs using the tail command. For example if your unique track id was `523586093e` then you can use it like below:

```
cat laravel.log | grep 523586093e

```

output:

```
[2024-06-26 00:36:12] production.DEBUG: AsanpardakhtController::token_request {"servicetypeid":1,"merchantconfigurationid":38718596,"localinvoiceid":17193495725213,"amountinrials":6980000,"localdate":"20240626 003612","callbackurl":"https://shop.test/payment/gateway-transactions/pqj5nm/callback","paymentid":0,"additionaldata":null,"settlementportions":[{"iban":"IR600780100710844707074710","amountInRials":6980000,"paymentId":0}],"sid":"","uip":"31.14.119.2","uid":"user","xTrackId":"523586093e"}
[2024-06-26 00:36:13] production.INFO: AsanpardakhtController::token_response hd764QZna1fl1ALEwjoA: 200 {"sid":"","uip":"31.14.119.2","uid":"user","xTrackId":"523586093e"}

```

Installation
------------

[](#installation)

```
composer require php-monsters/laravel-xlog
```

Add this to your app service providers (only for Laravel &lt; 5.5):

```
    PhpMonsters\Log\XLogServiceProvider::class,
```

Config (optional)
-----------------

[](#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
-----

[](#usage)

```
use PhpMonsters\Log\XLog; // or register XLog Facade

XLog::debug('my log message');
XLog::info('my log message');
XLog::notice('my log message');
XLog::warning('my log message');
XLog::error('my log message');
XLog::critical('my log message');
XLog::alert('my log message');
XLog::emergency('my log message');
```

Pass parameters
---------------

[](#pass-parameters)

```
// passing string as the second parameter
$string = 'test'
XLog::info('log message', [$string]);

// passing array
$array = ['a' => 1, 'b' => 2, 'c' => 'value3', 'd' => 4.2];
XLog::info('log message', $array);
// log input data in the controller's action
XLog::info('verify transaction request', $request->all());
```

Log exception
-------------

[](#log-exception)

```
// The first parameter is the thrown exception. The second parameter specifies whether to log the trace or not. the third parameter is the level of the log. default value is `error`.
XLog::exception($exception, true);
XLog::exception($exception, true, 'error');
XLog::exception($e, false, 'emergency');
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~83 days

Recently: every ~205 days

Total

15

Last Release

1360d ago

PHP version history (2 changes)1.0.1PHP &gt;=5.4

v1.3.0PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9299d1f63e54a717d0b785253adc636f90c3b460ae9bd24bfc1505ef5f90f1ec?d=identicon)[tartan](/maintainers/tartan)

---

Top Contributors

[![samuraee](https://avatars.githubusercontent.com/u/502961?v=4)](https://github.com/samuraee "samuraee (26 commits)")[![hosseinm1997](https://avatars.githubusercontent.com/u/19169253?v=4)](https://github.com/hosseinm1997 "hosseinm1997 (2 commits)")

---

Tags

loglaravelLaravel logxlogextended logger

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tartan-laravel-xlog/health.svg)

```
[![Health](https://phpackages.com/badges/tartan-laravel-xlog/health.svg)](https://phpackages.com/packages/tartan-laravel-xlog)
```

###  Alternatives

[spatie/laravel-activitylog

A very simple activity logger to monitor the users of your website or application

5.8k45.4M309](/packages/spatie-laravel-activitylog)[sentry/sentry-laravel

Laravel SDK for Sentry (https://sentry.io)

1.3k114.3M154](/packages/sentry-sentry-laravel)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[larabug/larabug

Laravel 6.x/7.x/8.x/9.x/10.x/11.x/12.x/13.x bug notifier

299549.3k1](/packages/larabug-larabug)[php-monsters/laravel-xlog

extended Laravel 5+ log

103.3k4](/packages/php-monsters-laravel-xlog)[saasscaleup/laravel-log-alarm

Laravel log Alarm help you to set up alarm when errors occur in your system and send you a notification via Slack and email

27025.0k](/packages/saasscaleup-laravel-log-alarm)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
