https://github.com/parseword/pickset
A collection of PHP utilities to quickly "unlock" various capabilities in any application
https://github.com/parseword/pickset
database date-formatting logger php php7 php71 singleton text-processing
Last synced: about 2 months ago
JSON representation
A collection of PHP utilities to quickly "unlock" various capabilities in any application
- Host: GitHub
- URL: https://github.com/parseword/pickset
- Owner: parseword
- License: apache-2.0
- Created: 2019-02-02T21:46:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-15T21:34:40.000Z (over 2 years ago)
- Last Synced: 2025-04-09T20:04:37.440Z (about 2 months ago)
- Topics: database, date-formatting, logger, php, php7, php71, singleton, text-processing
- Language: PHP
- Size: 24.4 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-Logger.md
- License: LICENSE
Awesome Lists containing this project
README
# Logger
Logger is a PHP text file logging facility, implemented as a singleton class.
## Usage
Implementing `Logger` in 4 easy steps:
1. Either `composer require parseword/pickset` or copy the `Logger.php` file
into your project.2. Make sure `Logger.php` is discoverable by your autoloader, or `require_once`
it manually.3. Throughout your application code, call `Logger::debug()`, `Logger::info()`,
`Logger::warning()` and `Logger::error()` to send log messages of differing
severity levels.4. In your application's config file or a common include file, you (or the user)
call `Logger::setFilename()` to set the log file, and `Logger::setSeverityFilter()`
to specify which log messages are written to disk.## Example
In the following example, a file named `/tmp/my.log` is created. The severity
filter is set so that only messages with severity of WARNING or higher will be
written. Messages with lower severity will be disregarded.```php