https://github.com/fryiee/custom_log
A custom Log class based on Monolog's Logger.
https://github.com/fryiee/custom_log
laravel log logger logging monolog php
Last synced: 3 months ago
JSON representation
A custom Log class based on Monolog's Logger.
- Host: GitHub
- URL: https://github.com/fryiee/custom_log
- Owner: fryiee
- License: mit
- Created: 2017-09-07T05:17:37.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-07T09:21:01.000Z (almost 9 years ago)
- Last Synced: 2025-06-06T11:03:13.613Z (about 1 year ago)
- Topics: laravel, log, logger, logging, monolog, php
- Language: PHP
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# custom_log 
A custom Log class based on Monolog's Logger.
## Installation
`composer require fryiee/custom_log`
Add `LOG_PATH` to your .env.
The package assumes the following:
- `LOG_PATH=laravel` will assume the same storage location as the `Log` facade
using `storage_path('logs')`
- `LOG_PATH=some/path/` will use that path to store logs. e.g. `./custom_logs`
- `LOG_PATH=` will default to the packages' own location of `fryiee/custom_log/logs`
Adding `LOG_DATE=true` to your .env will allow your logs to be dated in the same way as core Laravel logs
(Y-m-d format).
## Usage
```
use Fryiee\CustomLog\Log;
...
Log::info('name', 'message');
```
The logger uses the name to generate the log file. You can also use slashes to set a nested location:
```
Log::info('nested/name', 'message'); // creates a file at logs/nested/name.log
```