PHPackages                             sagarchauhan/bugfile - 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. sagarchauhan/bugfile

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

sagarchauhan/bugfile
====================

Bug Logger

v1.3(5y ago)118.3k↓48.3%MITPHP

Since Jan 18Pushed 4y ago1 watchersCompare

[ Source](https://github.com/sagarchauhan005/bugfile)[ Packagist](https://packagist.org/packages/sagarchauhan/bugfile)[ RSS](/packages/sagarchauhan-bugfile/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)DependenciesVersions (5)Used By (0)

BugFile
=======

[](#bugfile)

A simple package to capture and log all the bugs in your app and report it to our Bug Management and Incidence Reporting Tool for an in-depth analysis.

Screenshot
==========

[](#screenshot)

[![Imgur](https://camo.githubusercontent.com/a96fff91cee91250776a2c5aca31b914344fd54cbb6a82cfc7a377a13576b2dd/68747470733a2f2f692e696d6775722e636f6d2f4c6b434a4277442e6a7067)](https://camo.githubusercontent.com/a96fff91cee91250776a2c5aca31b914344fd54cbb6a82cfc7a377a13576b2dd/68747470733a2f2f692e696d6775722e636f6d2f4c6b434a4277442e6a7067)

[![Imgur](https://camo.githubusercontent.com/e978f239d95b2e578db40c593ae078060c677c140407b655e2594863bb32e75f/68747470733a2f2f692e696d6775722e636f6d2f783063455674752e6a7067)](https://camo.githubusercontent.com/e978f239d95b2e578db40c593ae078060c677c140407b655e2594863bb32e75f/68747470733a2f2f692e696d6775722e636f6d2f783063455674752e6a7067)

Installation
============

[](#installation)

Run `composer require sagarchauhan/bugfile` into your app and then follow the below steps.

Getting Started (PHP FRAMEWORK)
===============================

[](#getting-started-php-framework)

- Visit our [Bug Management and Incidence Reporting tool](https://logs.kartmax.in/) at create an account.
- Add your site
- You shall receive three keys for your LIVE, STAGING and DEV environment along with an end-point
- For any PHP based framework like LARAVEL, LUMEN, Zend etc. Paste the keys in your app's .env file.
- Lastly, paste the below code in your Handler.php file under `report` function

```
$bug = new BugFile();
$bug->causedBy(BugFile::DEFAULT_USER);
$bug->causedAt(BugFile::DEFAULT_SOURCE);
$bug->setSeverity(BugFile::LOG_INFO);
$bug->customData(BugFile::DEFAULT_DATA);
$bug->log($e);
$bug->setMessage(BugFile::DEFAULT_MESSAGE);
$bug->loggedBy(BugFile::DEFAULT_LOGGER);
$bug->save();
```

- This shall capture all the exceptions and report to our tool automatically.
- To manually report an exception, use the same above code at any `catch` block in `try-catch` method like below

```
try{
    // some logical code
}catch (Exception $e){
    $bug = new BugFile();
    $bug->causedBy(\Illuminate\Support\Facades\Auth::id());
    $bug->causedAt("Login Page");
    $bug->setSeverity(BugFile::LOG_INFO);
    $bug->customData(['last_login'=>'today']);
    $bug->log($e);
    $bug->setMessage('Something happened at login function');
    $bug->loggedBy('Sagar Chauhan - PM');
    $bug->save();
}
```

Getting Started (CORE PHP)
==========================

[](#getting-started-core-php)

- Visit our [Bug Management and Incidence Reporting tool](https://logs.greenhonchos.com/) at create an account.
- Add your site
- You shall receive three keys for your LIVE, STAGING and DEV environment along with an end-point
- Make sure to pass the below config array when you call the logger class ```
    #Add these lines just above the switch cases of pimresponse.php
    require './ExceptionHandler.php';
    $exceptionHandler = new ExceptionHandler(require 'config.php');
    $exceptionHandler->handleException();
    ```
- This shall capture all the exceptions and report to our tool automatically.
- To manually report an exception, use the same above code at any `catch` block in `try-catch` method like below

```
$config = [
      'APP_ENV'=>'local',
      'BUGFILE_END_POINT'=>'https://localhost:8002/api/logs',
      'BUGFILE_KEY_DEV'=>'',
      'BUGFILE_KEY_STAGING'=>'',
      'BUGFILE_KEY_LIVE'=>''
  ];

try{
    // some logical code
}catch (Exception $e){
    $bug = new BugFile($config);
    $bug->causedBy(\Illuminate\Support\Facades\Auth::id());
    $bug->causedAt("Login Page");
    $bug->setSeverity(BugFile::LOG_INFO);
    $bug->customData(['last_login'=>'today']);
    $bug->log($e);
    $bug->setMessage('Something happened at login function');
    $bug->loggedBy('Sagar Chauhan - PM');
    $bug->save();
}
```

Methods
=======

[](#methods)

List of all the methods that you can use to send logs to our tool

MethodDescriptionRequiredcausedBy()User id of the user who faces the exceptionFalsecausedAt()Location of exception, generally a file or page nameFalseseverity()Level of urgency for this exceptionTruecustomData()Any custom data like a payload or array you wish to passFalselog()The original exception we get in caught blockTruesetMessage()A plan message/comment to tag the exceptionTrueloggedBy()Name of developer who caught this exceptionFalsesave()saves the data and passes it to out toolTrueLog Severity
============

[](#log-severity)

SeverityCodeAlertLOG\_INFO0FalseLOG\_DEBUG1FalseLOG\_NOTICE2FalseLOG\_WARNING3FalseLOG\_ERROR4FalseLOG\_CRITICAL5TRUELOG\_ALERT5TRUELOG\_EMERGENCY7TRUEAuthor
======

[](#author)

[Sagar Chauhan](https://twitter.com/chauhansahab005) works as a Project Manager - Technology at [Greenhonchos](https://www.greenhonchos.com). In his spare time, he hunts bug as a Bug Bounty Hunter. Follow him at [Instagram](https://www.instagram.com/chauhansahab005/), [Twitter](https://twitter.com/chauhansahab005), [Facebook](https://facebook.com/sagar.chauhan3), [Github](https://github.com/sagarchauhan005)

Contributor
===========

[](#contributor)

- Harish Rawat

License
=======

[](#license)

MIT

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.1% 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 ~27 days

Total

4

Last Release

1912d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f2187404c123a66d5fb7ad905fd226e1a077c2108f973dd3fa280ba2d641e321?d=identicon)[sagarchauhan005](/maintainers/sagarchauhan005)

---

Top Contributors

[![sagar-chauhan-gh](https://avatars.githubusercontent.com/u/79831982?v=4)](https://github.com/sagar-chauhan-gh "sagar-chauhan-gh (16 commits)")[![sagarchauhan005](https://avatars.githubusercontent.com/u/7292512?v=4)](https://github.com/sagarchauhan005 "sagarchauhan005 (1 commits)")

### Embed Badge

![Health badge](/badges/sagarchauhan-bugfile/health.svg)

```
[![Health](https://phpackages.com/badges/sagarchauhan-bugfile/health.svg)](https://phpackages.com/packages/sagarchauhan-bugfile)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.5k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M276](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M343](/packages/open-telemetry-sdk)

PHPackages © 2026

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