Skip to content

programster/package-logging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logger PHP Package

This is a PSR-3 compatible logger package that provides some abstract loggers that allow:

  • Minimum level logging (MinLevelLogger)
  • Logging to multiple loggers (MultiLogger)
  • Prefix logging - add a prefix to all messages before logging to the underlying logger.
  • File logger - log to a file.

This package provides a PHP enum for the log level to simplify things. Hopefully the PSR-3 package will provide this itself at some point in the future.

You will likely want to take advantage of one of the following additional logging packages that make use of this package.

Install

composer require programster/log

Example Usage

/**
 * Get a logger for logging all the things.
 * @return \Psr\Log\LoggerInterface
 */
public function getLogger() : \Psr\Log\LoggerInterface
{
    return new \Programster\Log\FileLogger(filepath: "/path/to/my/logs.csv");
}

About

A PHP package for logging that is compliant with PSR-3

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages