PHPackages                             halilcosdu/laravel-logweaver - 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. halilcosdu/laravel-logweaver

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

halilcosdu/laravel-logweaver
============================

Laravel S3-compatible log system.

v1.0.6(2y ago)71.6k[1 PRs](https://github.com/halilcosdu/laravel-logweaver/pulls)MITPHPPHP ^8.2CI failing

Since Apr 16Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/halilcosdu/laravel-logweaver)[ Packagist](https://packagist.org/packages/halilcosdu/laravel-logweaver)[ Docs](https://github.com/halilcosdu/laravel-logweaver)[ RSS](/packages/halilcosdu-laravel-logweaver/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (13)Versions (10)Used By (0)

Laravel S3-compatible log system.
=================================

[](#laravel-s3-compatible-log-system)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b3f484ef2861f497928d71aa511f2bd75e6e969acfa44be7549d4741d24e7824/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68616c696c636f7364752f6c61726176656c2d6c6f677765617665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/halilcosdu/laravel-logweaver)[![GitHub Tests Action Status](https://camo.githubusercontent.com/dddd32b59d133d9924db762ed0790db9be30d62283e49ec9e1067edbcc3da7f5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f68616c696c636f7364752f6c61726176656c2d6c6f677765617665722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/halilcosdu/laravel-logweaver/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/fba76918aecd64681dcb7509069e7724d87b8f5dbc05c652d68f6f13dbdf4622/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f68616c696c636f7364752f6c61726176656c2d6c6f677765617665722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/halilcosdu/laravel-logweaver/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/533254798508bb83e3df691b0e266c46cee627bc897ff7ade4af0b7d031ef7ba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68616c696c636f7364752f6c61726176656c2d6c6f677765617665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/halilcosdu/laravel-logweaver)

Laravel LogWeaver
=================

[](#laravel-logweaver)

Laravel LogWeaver is a PHP package designed to provide a simple and flexible way to log events in your Laravel application. It offers a fluent interface for creating logs, allowing you to easily specify the log level, resource, content, and storage disk.

Features
--------

[](#features)

- **Fluent Interface**: Easily create logs with a fluent, chainable interface.
- **Multiple Log Levels**: Supports different log levels including 'info', 'warning', 'error', and 'critical'.
- **Resource Specification**: Specify the resource of the log, such as 'system' or 'event'.
- **Customizable Storage**: Choose your storage disk and directory.
- **Parameter Validation**: Ensures the validity of log parameters before logging.
- **Array and JSON Conversion**: Convert your logs to array or JSON format.
- **Asynchronous Logging**: Log events asynchronously with optional waiting for the log to be written to the disk.

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

[](#installation)

You can install the package via composer:

```
composer require halilcosdu/laravel-logweaver
```

```
composer require league/flysystem-aws-s3-v3 "^3.0" --with-all-dependencies
composer require league/flysystem-ftp "^3.0"
composer require league/flysystem-sftp-v3 "^3.0"
```

```
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
```

You can publish the config file with:

```
php artisan vendor:publish --tag="logweaver-config"
```

This is the contents of the published config file:

```
return [
    'sleep' => env('LOG_WEAVER_SLEEP', 0.5),
];
```

Usage
-----

[](#usage)

```
\HalilCosdu\LogWeaver\Facades\LogWeaver::description(string $description): static
\HalilCosdu\LogWeaver\Facades\LogWeaver::logResource(string $logResource): static
\HalilCosdu\LogWeaver\Facades\LogWeaver::level(string $level): static
\HalilCosdu\LogWeaver\Facades\LogWeaver::content(array $content): static
\HalilCosdu\LogWeaver\Facades\LogWeaver::disk(string $disk): static
\HalilCosdu\LogWeaver\Facades\LogWeaver::directory(string $directory): static
\HalilCosdu\LogWeaver\Facades\LogWeaver::relation(?array $relation): static
\HalilCosdu\LogWeaver\Facades\LogWeaver::log(?string $path = null, bool $wait = false): array
\HalilCosdu\LogWeaver\Facades\LogWeaver::download(string $path, $name = null, array $headers = []): StreamedResponse
\HalilCosdu\LogWeaver\Facades\LogWeaver::delete(string|array $paths): bool
\HalilCosdu\LogWeaver\Facades\LogWeaver::validation(?bool $validation): static
\HalilCosdu\LogWeaver\Facades\LogWeaver::get(string $path): string
\HalilCosdu\LogWeaver\Facades\LogWeaver::toArray(): array
\HalilCosdu\LogWeaver\Facades\LogWeaver::toJson($options = 0): false|string
```

```
$log = LogWeaver::description('User logged in')
    ->logResource('event')
    ->content(['email' => 'test@example.com'])
    ->level('info')
    ->relation(['user_id' => 1])
    ->toArray();
```

```
$log = LogWeaver::description('System error occurred')
    ->logResource('system')
    ->content(['error' => 'Database connection failed'])
    ->level('error')
    ->log($path, $wait);
```

```
$log = LogWeaver::description('Payment gateway down')
    ->logResource('event')
    ->content(['gateway' => 'Stripe', 'status' => 'down'])
    ->level('critical')
    ->log();
```

```
$log = LogWeaver::description('Disk space running low')
    ->logResource('system')
    ->content(['disk_space' => '10% remaining'])
    ->level('warning')
    ->toJson();
```

```
$log = LogWeaver::description('User registered')
    ->logResource('event')
    ->content(['user_id' => 2, 'email' => 'newuser@example.com'])
    ->level('info')
    ->disk('local')
    ->directory('custom_logs')
    ->log();
```

If you want to disable built-in validation, you can use the following methods:

Built-in validations are:

```
$rules = [
    'level' => ['required', 'in:info,warning,error,critical'],
    'log_resource' => ['required', 'in:system,event'],
    'description' => ['required', 'string'],
    'directory' => ['string'],
    'disk' => ['string', 'in:s3,local,ftp,sftp,public'],
    'content' => ['required', 'array'],
];
```

```
$log = LogWeaver::description('User registered')
    ->validation(false)
    ->logResource('custom_input')
    ->content(['user_id' => 2, 'email' => 'newuser@example.com'])
    ->level('custom_input')
    ->disk('custom_input')
    ->directory('custom_logs')
    ->log();
```

```
$response = LogWeaver::download(string $path, $name = null, array $headers = []): StreamedResponse;
$response = LogWeaver::delete(string|array $paths): bool;
$response = LogWeaver::get(string $path): string;
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Halil Cosdu](https://github.com/halilcosdu)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance61

Regular maintenance activity

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.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 ~3 days

Total

7

Last Release

736d ago

### Community

Maintainers

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

---

Top Contributors

[![halilcosdu](https://avatars.githubusercontent.com/u/6373017?v=4)](https://github.com/halilcosdu "halilcosdu (30 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelHalilCosdularavel-logweaver

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/halilcosdu-laravel-logweaver/health.svg)

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

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[spatie/laravel-slack-alerts

Send a message to Slack

3212.6M4](/packages/spatie-laravel-slack-alerts)[keepsuit/laravel-opentelemetry

OpenTelemetry integration for laravel

142347.8k](/packages/keepsuit-laravel-opentelemetry)[spatie/laravel-error-share

Share your Laravel errors to Flare

43965.6k3](/packages/spatie-laravel-error-share)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[tapp/filament-maillog

Filament plugin to view outgoing mail

2952.6k1](/packages/tapp-filament-maillog)

PHPackages © 2026

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