Download the PHP package harbor/monolog-manager without Composer

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

Monolog Manager

Monolog Manager allows you to easily create and use multiple logging channels. The manager utilizes Monolog Factory for easy, configuration-based, creation of the Loggers.

You can optionally use a PSR-11 dependency injection container for Handler, Processor, and Formatter resolution within your logger configuration.

Installation

The preferred method of installation is via Composer. Run the following command to install the latest version of a package and add it to your project's composer.json:

Usage

Adding logging channels

Logging to the default channel

The Manager implements the Psr\Log\LoggerInterface, and sends the log message to the default channel.

Additionally, you can call any method on the default channel's Mongolog\Logger instance:

Logging to a specific channel

Using the channel(?string $name = null) method on Manager, you can get that channel's Mongolog\Logger instance:

Emergency Logger

By default, the Manager will return a default "emergency logger" if an error occurs while creating the Logger instance".

This is to prevent logging configuration/usage issues from stopping script execution.

The default emergency logger added via:

Supplying your own emergency logger:

Simply add a channel, using Manager::EMERGENCY_CHANNEL as the channel name.

Disabling the emergency logger

Using a Dependency Injection Container

To use a PSR-11 container to resolve dependencies:

Setup

Using the container in your channel config

The handlers, processors, and formatter are resolved using the following logic:

_Note: The term callable refers to any value where is_callable($value) === true OR any class where method_exists($value, '__invoke')_

  1. If value is an object of the correct type: $value = $value
  2. If value is a string, and $container->has($value): $value = $container->get($value)
  3. If value is a string, and is callable: $value = $value($container)
  4. If value is an array, and isset($value['formatter']): $value['formatter'] = $this->resolve($value['formatter'])

If the value cannot be resolved, an InvalidArgumentException is thrown (which gets sent to the emergency logger by default, see above)

Example of all possible values:

License

Released under MIT License


All versions of monolog-manager with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
monolog/monolog Version ^2.2
nikolaposa/monolog-factory Version ^3.1
psr/container Version ^1.0
psr/log Version ^1.1
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 harbor/monolog-manager contains the following files

Loading the files please wait ....