Download the PHP package corpus/loggers without Composer

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

(PSR-3) Loggers and Logging Utilities

Latest Stable Version License ci.yml

Utilities for and Loggers for PSR-3: Logger Interface.

Requirements

Installing

Install the latest version with:

Example

This example demonstrates how the loggers may be chained together to create complex interactions

Documentation

Class: \Corpus\Loggers\Interfaces\LoggerWithContextInterface

Method: LoggerWithContextInterface->withContext

Returns a new instance with the given context
replacing the existing context.


Method: LoggerWithContextInterface->withAddedContext

Returns a new instance with the given context
added to the existing context.

Class: \Corpus\Loggers\Interfaces\MultiLoggerInterface

Method: MultiLoggerInterface->withAdditionalLoggers

withAdditionalLoggers returns a new instance with the given loggers
added to the list of loggers to delegate to.

Class: \Corpus\Loggers\Interfaces\WithAdditionalLoggersInterface

Method: WithAdditionalLoggersInterface->withAdditionalLoggers

withAdditionalLoggers returns a new instance with the given loggers
added to the list of loggers to delegate to.

Class: \Corpus\Loggers\Interfaces\WithContextInterface

Method: WithContextInterface->withContext

Returns a new instance with the given context
replacing the existing context.


Method: WithContextInterface->withAddedContext

Returns a new instance with the given context
added to the existing context.

Class: \Corpus\Loggers\LoggerVerbosityFilter

LoggerVerbosityFilter mutes log messages based on a given integer verbosity level.

By default,

The levels can be changed by passing a callback redefine the verbosity level for each log level.

The verbosity level can be changed by calling withVerbosity()

Method: LoggerVerbosityFilter->__construct

Parameters:

Method: LoggerVerbosityFilter->withVerbosity

Returns a new instance with the specified verbosity level.


Method: LoggerVerbosityFilter->withVerbosityFromLevelCallback

Returns a new instance with the specified verbosity level callback.

Class: \Corpus\Loggers\LoggerWithContext

LoggerWithContext is a logger that adds a given context to all log messages before delegating to another logger.

This is useful for adding context to all log messages, such as the current request ID, IP address or the current user ID.

Method: LoggerWithContext->__construct

Create a new LoggerWithContext instance with the given logger and context.

The given context will be added to all log messages.

Parameters:

Method: LoggerWithContext->withContext

Returns a new instance with the given context
replacing the existing context.


Method: LoggerWithContext->withAddedContext

Returns a new instance with the given context
added to the existing context.

Class: \Corpus\Loggers\LogLevelFilter

LogLevelFilter is a PSR Logger that filters logs based on the log level.

It can be used to filter out log messages that are not needed for a specific use case.

For example, you may want to log all messages at the DEBUG level to a file, but only log messages at the ERROR level or higher to the console.

This logger can be used to filter out the DEBUG messages from the console logger.

This logger accepts a list of log levels to filter, and a boolean indicating whether to exclude or include the given log levels.

Method: LogLevelFilter->__construct

Parameters:

Class: \Corpus\Loggers\LogLevelLoggerMux

LogLevelLoggerMux is a PSR Logger that multiplexes logs to different loggers based on the log level.

Method: LogLevelLoggerMux->__construct

Parameters:

Method: LogLevelLoggerMux->withEmergencyLogger

Returns a new instance with the specified logger handling the Emergency log level.


Method: LogLevelLoggerMux->withAlertLogger

Returns a new instance with the specified logger handling the Alert log level.


Method: LogLevelLoggerMux->withCriticalLogger

Returns a new instance with the specified logger handling the Critical log level.


Method: LogLevelLoggerMux->withErrorLogger

Returns a new instance with the specified logger handling the Error log level.


Method: LogLevelLoggerMux->withWarningLogger

Returns a new instance with the specified logger handling the Warning log level.


Method: LogLevelLoggerMux->withNoticeLogger

Returns a new instance with the specified logger handling the Notice log level.


Method: LogLevelLoggerMux->withInfoLogger

Returns a new instance with the specified logger handling the Info log level.


Method: LogLevelLoggerMux->withDebugLogger

Returns a new instance with the specified logger handling the Debug log level.

Class: \Corpus\Loggers\MemoryLogger

MemoryLogger is a PSR Logger that stores all logs in local memory.

This is primarily useful for testing purposes.


Method: MemoryLogger->getLogs

getLogs returns all logs that have been logged to this logger.

The returned array is a list of log records, each of which is an array keyed by
Returns:

Method: MemoryLogger->clearLogs

clearLogs clears all logs that have been logged to this logger.

Class: \Corpus\Loggers\MultiLogger

MultiLogger is a PSR Logger that delegates logs to multiple other loggers.

Method: MultiLogger->__construct

Create a new MultiLogger instance with the given loggers to delegate to.


Method: MultiLogger->withAdditionalLoggers

withAdditionalLoggers returns a new instance with the given loggers
added to the list of loggers to delegate to.

Class: \Corpus\Loggers\StreamResourceLogger

StreamResourceLogger is a PSR Logger that writes to a stream resource.

This is particularly useful for writing to STDERR or STDOUT, or to a file.

Method: StreamResourceLogger->__construct

Parameters:

Throws: \Corpus\Loggers\Exceptions\LoggerArgumentException - If the given resource is not a stream

Throws: \Corpus\Loggers\Exceptions\LoggerInitException - If the given resource is not writable


All versions of loggers with dependencies

PHP Build Version
Package Version
Requires psr/log Version ^1 || ^2 || ^3
php Version ^7.4 || ^8.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 corpus/loggers contains the following files

Loading the files please wait ....