Download the PHP package central-logs/laravel without Composer

On this page you can find all versions of the php package central-logs/laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel

Central Logs Laravel

Latest Version on Packagist Tests PHPStan Total Downloads

A powerful and flexible Laravel package for sending logs to Central Logs system with support for synchronous, asynchronous, and batch processing modes. Achieve up to 251x faster logging performance with intelligent batch aggregation.

Features

Version Compatibility

Package Version Laravel PHP Monolog
1.3+ 9.x, 10.x, 11.x, 12.x ^8.0 ^2.0|^3.0
1.0-1.2 10.x, 11.x, 12.x ^8.1 ^3.0

Requirements

Performance Benchmarks

Real-world performance testing with Central Logs API:

Mode Speed Blocking Queued Speedup Best For
SYNC 170.83ms Yes No 1x Critical logs
ASYNC 57.71ms No Yes 3x High-throughput
BATCH 0.68ms No On flush 251x Optimal performance

Batch mode processes logs 251x faster than sync mode!

Installation

Step 1: Install via Composer

Step 2: Publish Configuration

This will create a config/central-logs.php file in your Laravel application.

Important: The package will work in "null mode" (no logs sent) until you configure the API credentials in Step 3.

Step 3: Configure Environment

Add the following to your .env file:

Step 4: Add Middleware (Recommended for Batch Mode)

Add the flush middleware to app/Http/Kernel.php to ensure logs are sent at the end of each request:

Why? In batch mode, logs are collected and sent in batches. Without this middleware, logs may wait until batch size (default: 50) or timeout (default: 5s) is reached. The middleware ensures logs are flushed after each request.

Step 5: Update Logging Configuration

Add the Central Logs channel to your config/logging.php:

Step 6: Test Connection

Quick Start

Once configured, you can use Laravel's logging as usual:

Configuration

Logging Modes

Synchronous Mode

Logs are sent immediately (blocks the request):

Pros: Logs are sent immediately Cons: Adds latency to requests

Asynchronous Mode (Recommended)

Logs are queued and sent via Laravel Queue:

Pros: Non-blocking, fast Cons: Requires queue worker to be running

Batch Processing

Enable batch processing to reduce API calls:

How it works:

Configuration Reference

All available configuration options in config/central-logs.php:

Advanced Usage

Custom Metadata

Add custom metadata to all logs:

Using Specific Channel

Log only to Central Logs:

Conditional Logging

Log to Central Logs only in production:

Exception Handling

The package automatically extracts exception details:

Queue Configuration

For async mode, you need a queue worker running:

Using Redis (Recommended)

Using Database

Start Queue Worker

Supervisor Configuration

Create /etc/supervisor/conf.d/central-logs-worker.conf:

Troubleshooting

Connection Test Fails

Check:

  1. Central Logs is running and accessible
  2. API key is correct
  3. Firewall/network settings allow connection
  4. URL is correct (include http:// or https://)

Logs Not Appearing

In Async Mode:

In Batch Mode (Most Common Issue):

Problem: Logs not sent immediately, waiting until batch size or timeout reached

Solutions:

  1. Add Flush Middleware (Recommended):

  2. Lower Batch Settings for Development:

  3. Disable Batching for Testing:

  4. Manual Flush in Tinker:

Performance Issues

Sync mode is slow:

Queue backing up:

Development

Setup Development Environment

Run Tests

Code Quality

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see LICENSE for more information.

Credits

Support


All versions of laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/contracts Version ^9.0|^10.0|^11.0|^12.0
illuminate/queue Version ^9.0|^10.0|^11.0|^12.0
illuminate/console Version ^9.0|^10.0|^11.0|^12.0
monolog/monolog Version ^2.0|^3.0
guzzlehttp/guzzle Version ^7.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package central-logs/laravel contains the following files

Loading the files please wait ...