承接 salehhub/laravel-remote-logger 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

salehhub/laravel-remote-logger

Composer 安装命令:

composer require salehhub/laravel-remote-logger

包简介

Send Laravel logs to a centralized remote logging server

README 文档

README

Send your Laravel application logs to a centralized remote logging server.

Features

  • Zero config — just install, set env vars, and go
  • Bearer token authentication
  • Asynchronous logging (queued) to avoid slowing down requests
  • Automatic retry on failure (3 attempts with backoff)
  • Configurable timeout and SSL verification
  • Fallback to local logging on failure

Installation

composer require salehhub/laravel-remote-logger

The package auto-registers via Laravel's package discovery.

Configuration

1. Add Environment Variables

REMOTE_LOGGER_URL=https://your-logging-server.com/api/logs
REMOTE_LOGGER_API_KEY=your-api-key
REMOTE_LOGGER_APP_NAME=MyApp

All available environment variables:

Variable Default Description
REMOTE_LOGGER_URL http://localhost:8000/api/logs Remote server endpoint
REMOTE_LOGGER_API_KEY null Bearer token for authentication
REMOTE_LOGGER_APP_NAME APP_NAME Application identifier
REMOTE_LOGGER_LEVEL debug Minimum log level to send
REMOTE_LOGGER_ASYNC true Send logs via queue
REMOTE_LOGGER_QUEUE null Queue name (null = default queue)
REMOTE_LOGGER_VERIFY_SSL true Verify SSL certificates
REMOTE_LOGGER_TIMEOUT 5 HTTP request timeout in seconds

2. Set as Default Log Channel

LOG_CHANNEL=remote

The remote channel is auto-registered by the package. No need to edit config/logging.php.

3. Queue Setup (for async logging)

php artisan queue:work

Usage

use Illuminate\Support\Facades\Log;

Log::info('User logged in', ['user_id' => 123, 'category' => 'Auth', 'subcategory' => 'Login']);
Log::error('Payment failed', ['order_id' => 456, 'category' => 'Payments', 'subcategory' => 'Stripe']);
Log::warning('High memory usage detected', ['category' => 'System']);

Global Context (Optional)

You can set a global category or subcategory that applies to all logs in the current request or job. This is useful for assigning a broad category to an entire request cycle.

use RemoteLogger\Facades\RemoteLogger;

// At the beginning of a request or job
RemoteLogger::setContext('Billing', 'StripeProvider');

// Or separately
RemoteLogger::setCategory('Billing');
RemoteLogger::setSubcategory('StripeProvider');

Global settings (via RemoteLogger facade) will always take precedence over values provided in the log context.

Remote Server Payload

Your server should accept POST requests with this JSON structure:

{
    "application": "MyApp",
    "environment": "production",
    "level": "info",
    "message": "User logged in",
    "category": "Auth",
    "subcategory": "Login",
    "context": {"user_id": 123},
    "logged_at": "2024-02-08 10:30:00"
}

The request includes an Authorization: Bearer <api_key> header when REMOTE_LOGGER_API_KEY is set.

Publishing Config

php artisan vendor:publish --tag=remote-logger-config

Synchronous Mode

Set REMOTE_LOGGER_ASYNC=false to send logs synchronously (not recommended for production).

License

MIT

salehhub/laravel-remote-logger 适用场景与选型建议

salehhub/laravel-remote-logger 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 596 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「logging」 「remote」 「laravel」 「centralized」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 salehhub/laravel-remote-logger 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 salehhub/laravel-remote-logger 我们能提供哪些服务?
定制开发 / 二次开发

基于 salehhub/laravel-remote-logger 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 596
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 26
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-09