Download the PHP package mellivora/logger-factory without Composer

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

Logger Factory for Monolog Build Status

该库基于 monolog 进行开发,针对 monolog 进行了一系列的扩展,及配置增强功能。

1. 安装

2. 使用

根据配置文件实例化

php/yaml/json/ini/xml 格式通过 buildWith() 方法加载配置,需要 hassankhan/config 库的支持,其中 yaml 格式需要 symfony/yaml 库的支持

创建一个已定义的 logger

根据 default 获取一个未定义的 logger

复制一个 logger

根据 handlers 配置,创建一个 logger

也可以把自己定义的 logger 添加到 factory 中

并以自定义的 logger 做为默认 logger

3. 配置

Logger-Factory 支持灵活的配置方式,同时在引入 hassankhan/config 库后,可以支持 yaml/json/ini/xml 等格式的配置文件,具体请参考配置目录文件。

推荐安装 symfony/yaml 库后使用,因为 yaml 格式使得配置文件看起来更清晰可读。

3.1 配置文件说明

关于 formatte processor handler 的相关信息,请查看monolog的帮助说明

配置方法

配置文件中,通过 class 指定类的全名,params 指定参数列表。 参考代码内容

3.1.1 formatters

用于最终输出日志消息的格式,通过对应的命名及参数设置,可以提供给后面的 handlers 使用。

3.1.2 processors

通过加载注册的 processor 将会附加在消息的 extra 字段中。

Logger-Factory 中,增加了下面几种 processor 来增强日志的附属信息:

3.1.3 handlers

通过拼装 formatter/processor,用于日志输出方式的设定。

Logger-Factory 中,增加了下面几种 handler 来进行日志存储:

3.1.4 loggers

当声明的 logger 不在以下列表中时,默认为 default。参考默认配置:

4. 过滤器的使用

Mellivora\Logger\Logger 新增了 filter 过滤器的支持。

对日志消息进行替换

对日志消息进行过滤

自定义过滤器类

5. 日志路径支持

Mellivora\Logger\LoggerFactory 提供了关于项目根目录设置的方法,用于来协助日志文件目录定位。

Mellivora\Logger\Handler\NamedRotatingFileHandler 中,采用了如下方法来获取日志目录

你也可以利用 LoggerFactory::getRootPath() 来定义自己的日志 handler,协助方便的指定日志路径。

License

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


All versions of logger-factory with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
monolog/monolog Version ~1.23
psr/log Version ~1.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 mellivora/logger-factory contains the following files

Loading the files please wait ....