2017 © Pedro Peláez
 

library simple-log

A simple log wrapper around syslog, loosely based on PSR-3

image

makopov/simple-log

A simple log wrapper around syslog, loosely based on PSR-3

  • Saturday, March 5, 2016
  • by makopov
  • Repository
  • 1 Watchers
  • 1 Stars
  • 27 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

simple-log

A simple log wrapper around syslog, (*1)

, (*2)

Simple Log is a singleton class that makes logging to syslog very easy., (*3)

Get an object instance:, (*4)

$oLogger = SLog::getInstance();

Configure application name (optional). If not set syslog will show 'php' as the application name. Good to do upon a bootstrap or init of applications., (*5)

$oLogger->setApplicationName('MyApp');

Now log! Using any of the 8 log level, (*6)

$oLogger->emergency('some message');
$oLogger->alert('some message');
$oLogger->critical('some message');
$oLogger->error('some message');
$oLogger->warning('some message');
$oLogger->notice('some message');
$oLogger->info('some message');
$oLogger->debug('some message');

Log messages will appear in syslog (/var/log/messages). By default Simple Log will include the file name and line number of where the log was made from., (*7)

Example:, (*8)

Foo.php, (*9)

function foo() {
    $oLogger->warning('something happened');
}

Will show up in syslog like so:, (*10)

Feb 26 22:11:47 localhost MyApp: Foo.php:2 - something happened, (*11)

Thats it! Please submit bugs as you see them. I will add tests in the near future., (*12)

The Versions

05/03 2016

dev-master

9999999-dev

A simple log wrapper around syslog, loosely based on PSR-3

  Sources   Download

MIT

by Michael Akopov

05/03 2016

v1.0.8

1.0.8.0

A simple log wrapper around syslog, loosely based on PSR-3

  Sources   Download

MIT

by Michael Akopov

03/03 2016

v1.0.7

1.0.7.0

A simple log wrapper around syslog, loosely based on PSR-3

  Sources   Download

MIT

by Michael Akopov

03/03 2016

v1.0.6

1.0.6.0

A simple log wrapper around syslog, loosely based on PSR-3

  Sources   Download

MIT

by Michael Akopov

02/03 2016

v1.0.5

1.0.5.0

A simple log wrapper around syslog, loosely based on PSR-3

  Sources   Download

MIT

by Michael Akopov

02/03 2016

v1.0.4

1.0.4.0

A simple log wrapper around syslog, loosely based on PSR-3

  Sources   Download

MIT

by Michael Akopov

02/03 2016

v1.0.3

1.0.3.0

A simple log wrapper around syslog, loosely based on PSR-3

  Sources   Download

MIT

by Michael Akopov

01/03 2016

v1.0.0

1.0.0.0

A simple log wrapper around syslog, loosely based on PSR-3

  Sources   Download

MIT

by Michael Akopov