Download the PHP package migears/log without Composer

On this page you can find all versions of the php package migears/log. 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 log

migears/log

Version

Minimalist PSR-3 compliant logger for PHP. One class, zero magic.

A single Logger class that implements the full PSR-3 interface. No handler chains, no formatters, no configuration files. Just a callable handler, level threshold, and channel support — small enough to read in minutes.

Background: miGears is the open-source successor of TinyGears, a self-developed PHP framework. It was renamed and open-sourced recently because the name TinyGears is already taken in the open-source community.

Features

Boundaries

In scope

Not in scope (by design)

Installation

Requires: PHP 8.1+.

Quick Start

Stream Logger (stderr)

Null Logger (testing / production disable)

Custom Handler

Log Levels

Context Interpolation

Per PSR-3 spec, {placeholder} in the message is replaced with the corresponding context value:

Scalar values and Stringable objects are interpolated. null becomes "null" and booleans are spelled out as true/false. Non-scalar values (arrays, objects) are left as-is (placeholder stays).

Output Format

Example:

API Reference

Method Description
new Logger(callable $handler, string $minLevel = DEBUG, string $channel = '') Create with custom handler
Logger::toFile(string $path, $level = DEBUG, $channel = '') Create file logger
Logger::toStream($stream, $level = DEBUG, $channel = '') Create stream logger
Logger::null() Create null (no-op) logger
debug($message, $context = []) Debug level log
info($message, $context = []) Info level log
notice($message, $context = []) Notice level log
warning($message, $context = []) Warning level log
error($message, $context = []) Error level log
critical($message, $context = []) Critical level log
alert($message, $context = []) Alert level log
emergency($message, $context = []) Emergency level log
log($level, $message, $context = []) Log at arbitrary level

Design Philosophy

miGears Log follows the miGears philosophy: minimal, readable, and useful.

What we don't do:

Integration with miGears Web

License

MIT


migears/log

Version

极简 PSR-3 兼容 PHP 日志器。一个类,零魔法。

单个 Logger 类实现完整的 PSR-3 接口。没有处理器链,没有格式化器,没有配置文件。只有一个可调用的 handler、级别阈值和 channel 支持——小到几分钟就能读完。

特性

边界

范围内

范围外(刻意不做)

安装

要求:PHP 8.1+。

快速开始

流日志(stderr)

空日志器(测试 / 生产环境禁用)

自定义 Handler

日志级别

上下文插值

按 PSR-3 规范,消息中的 {placeholder} 会被对应的上下文值替换:

标量值和 Stringable 对象会被插值。null 变为 "null",布尔值明确输出为 true/false。非标量值(数组、对象)保持原样(占位符保留)。

输出格式

示例:

API 参考

方法 说明
new Logger(callable $handler, string $minLevel = DEBUG, string $channel = '') 使用自定义 handler 创建
Logger::toFile(string $path, $level = DEBUG, $channel = '') 创建文件日志器
Logger::toStream($stream, $level = DEBUG, $channel = '') 创建流日志器
Logger::null() 创建空(无操作)日志器
debug($message, $context = []) Debug 级别日志
info($message, $context = []) Info 级别日志
notice($message, $context = []) Notice 级别日志
warning($message, $context = []) Warning 级别日志
error($message, $context = []) Error 级别日志
critical($message, $context = []) Critical 级别日志
alert($message, $context = []) Alert 级别日志
emergency($message, $context = []) Emergency 级别日志
log($level, $message, $context = []) 任意级别日志

设计哲学

miGears Log 遵循 miGears 设计哲学:极简、可读、实用。

我们不做的事:

与 miGears Web 集成

许可证

MIT


All versions of log with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
psr/log Version ^3.0
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 migears/log contains the following files

Loading the files please wait ...