Download the PHP package detain/tracy-monolog-adapter without Composer

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

Detain Tracy-Monolog Adapter

Downloads this Month Stable version

A small bridge that lets the Tracy debugger log through a Monolog logger so you can route Tracy's log calls (warnings, errors, exceptions) through any Monolog handler, processor or formatter you already use.

Includes:

Requirements

Dependency Version
PHP >=8.1
tracy/tracy ^2.10
monolog/monolog ^3.0
nette/di ^3.0 (only for the Nette DI bridge)

Installation

Usage

Plain PHP

Wire a Monolog logger and pass it to TracyMonoLogger, then register the result with Tracy's Debugger.

After this, every call Tracy makes to its ILogger (warnings, errors, uncaught exceptions, manual Debugger::log() calls) is routed through your Monolog stack.

Priority mapping

TracyMonoLogger maps Tracy priority strings to Monolog Level cases:

Tracy constant Monolog Level
ILogger::DEBUG Level::Debug
ILogger::INFO Level::Info
ILogger::WARNING Level::Warning
ILogger::ERROR Level::Error
ILogger::EXCEPTION Level::Critical
ILogger::CRITICAL Level::Critical

Unknown priorities fall back to Level::Error.

Throwable handling

When Debugger::log() is called with a Throwable, the throwable is moved into the Monolog record context under the exception key. If you have pushed TracyExceptionProcessor onto your logger, that processor will:

  1. Render the throwable to a Tracy BlueScreen HTML file in the configured log directory (file name exception--Y-m-d--H-i--{hash}.html), reusing an existing file if one for the same hash is already present.
  2. Add tracy_filename (just the basename) and tracy_created (true if this call wrote the file, false if it pre-existed) to the record context.
  3. Replace the record message with a human-readable summary of the throwable chain when the original message is empty.

Nette DI

Register the bundled compiler extension in your NEON config:

By default this registers:

After compilation the extension also injects \Tracy\Debugger::setLogger($this->getByType(\Tracy\ILogger::class)) into the container's initialize() method, so Tracy itself begins routing through Monolog as soon as the container boots.

To reuse an existing Monolog logger service instead of letting the extension create one, pass it via the extension config:

Architecture

Two namespaces are exposed:

License

New BSD License. See the license file for details.

Credits

Originally based on the Nextras Tracy-Monolog Adapter by the Nextras contributors, with portions (BlueScreen rendering, exception file naming, exception summary formatting) adapted from Nette Tracy by David Grudl. Maintained for the Detain project by the Detain Project contributors.


All versions of tracy-monolog-adapter with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
tracy/tracy Version *
monolog/monolog Version *
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 detain/tracy-monolog-adapter contains the following files

Loading the files please wait ...