2017 © Pedro Peláez
 

library simple-logger

Simple way to create instance of Monolog\Logger

image

mikeevstropov/simple-logger

Simple way to create instance of Monolog\Logger

  • Monday, July 10, 2017
  • by mikeevstropov
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

mikeevstropov/simple-logger

Simple way to create instance of Monolog\Logger, (*1)

Installation

Add dependency mikeevstropov/simple-logger, (*2)

$ composer require mikeevstropov/simple-logger

Usage

<?php

use Mikeevstropov\SimpleLogger\LoggerFactory;

$logger = LoggerFactory::create(
    'path/to/file.log',
    'DEBUG',
    'log-name'
);

// add records to the log
$logger->warning('Warning message');
$logger->error('Error message');
// .. or other levels described by RFC 5424

LoggerFactory Interface

  • create, (*3)

    Returns instance of Monolog\Logger, (*4)

    Arguments:, (*5)

    • file (string) - path to the log file
    • level (string) - log level or "DEBUG" as default
    • name (string) - name of logger or "logger" as default

    Returns:, (*6)

    • Monolog\Logger

Log Levels

Monolog supports the logging levels described by RFC 5424., (*7)

  • DEBUG (100): Detailed debug information., (*8)

  • INFO (200): Interesting events. Examples: User logs in, SQL logs., (*9)

  • NOTICE (250): Normal but significant events., (*10)

  • WARNING (300): Exceptional occurrences that are not errors. Examples: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong., (*11)

  • ERROR (400): Runtime errors that do not require immediate action but should typically be logged and monitored., (*12)

  • CRITICAL (500): Critical conditions. Example: Application component unavailable, unexpected exception., (*13)

  • ALERT (550): Action must be taken immediately. Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up., (*14)

  • EMERGENCY (600): Emergency: system is unusable., (*15)

Development

Clone, (*16)

$ git clone https://github.com/mikeevstropov/simple-logger.git

Go to project, (*17)

$ cd simple-logger

Install dependencies, (*18)

$ composer install

Run the tests, (*19)

$ composer test

The Versions

10/07 2017

dev-master

9999999-dev

Simple way to create instance of Monolog\Logger

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mike Evstropov

10/07 2017

1.0.0

1.0.0.0

Simple way to create instance of Monolog\Logger

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mike Evstropov