Skip to content

Commit 4cea617

Browse files
authored
Create README.md
1 parent 86db432 commit 4cea617

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
Log Artisan
2+
===========
3+
4+
Access laravel logs through the Artisan Console.
5+
6+
This package is using [devdot/monolog-parser](https://github.com/devdot/monolog-parser) to parse logfiles that were created by Laravel.
7+
8+
## Installation
9+
10+
Add the package to your Laravel application:
11+
12+
```bash
13+
composer require devdot/log-artisan
14+
```
15+
16+
## Basic Usage
17+
18+
Take a look at the last few log entries using the console:
19+
20+
```bash
21+
php artisan log:show
22+
```
23+
24+
Example result:
25+
26+
![log-show](https://user-images.githubusercontent.com/3763567/223183564-a45a6a74-459c-4c5e-8169-e5d780940901.PNG)
27+
28+
Show the results in a compressed single line view using `--singleline` or `-s`:
29+
30+
![log-show-singleline](https://user-images.githubusercontent.com/3763567/223183791-2be7ea2c-2ad9-4cdb-9185-1d3bbebf161f.PNG)
31+
32+
Search through logs using `log:search`, with search terms that can be regex:
33+
34+
![log-search](https://user-images.githubusercontent.com/3763567/223183949-92c79a55-0faa-4b88-9555-cea0fc5a468b.PNG)
35+
36+
## Documentation
37+
38+
### About Command
39+
40+
View details about the current logging configuration and status:
41+
42+
```bash
43+
php artisan log:about
44+
```
45+
46+
### Show Command
47+
48+
Show entries from the logs (this will merge all logfiles and sort by date).
49+
50+
```bash
51+
php artisan log:show
52+
```
53+
54+
Use these options to narrow the results:
55+
56+
| Option | Name | Description |
57+
|--------|------|-------------|
58+
|-c, --count | Count | Show this amount of entries, default is 10 |
59+
|-l, --level | Log Level | Show only entries with this log level |
60+
|--channel | Log Channel | Use this specified logging channel |
61+
|--short | Short view | Only show short snippets |
62+
|-s, --singleline | Single-line view | Show single-lined layout |
63+
|--stacktrace | Stacktrace view | Show the full stacktrace |
64+
65+
Example (show full logged stacktraces for the latest 100 log entries with level DEBUG):
66+
67+
```bash
68+
php artisan log:show -c100 --level=DEBUG --stacktrace
69+
```
70+
71+
### Search Command
72+
73+
Search through the results with a given search term. The search term is treated as PHP regular expression, so make sure to escape any special characters like `.` or `*`.
74+
75+
```bash
76+
php artisan log:search test
77+
php artisan log:search "(test|regex \w+)"
78+
```
79+
80+
Options are the same as with `log:show`.

0 commit comments

Comments
 (0)