mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-27 00:25:50 +03:00
[GH-ISSUE #689] Read log files with monolog? #254
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#254
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Nov 20, 2015).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/689
Is it possible to read log files which are written with monolog?
If not: Is there any PHP library which is working on this?
I like to add a "view logs" page to our administration interface.
@quantumpacket commented on GitHub (Nov 21, 2015):
You can save the log files as JSON using the
JsonFormatter. You then basically do the following:Keep in mind the size of the log files as this basic example would load it all into memory. You'd want to cache what you want, or rotate logs when they reach an acceptable max size.
There are also options to save log records to a database. This would be easier for retrieval, but depending on how many records are being logged for each request based on your application it may impact performance.
You should just check out the documentation to find what suits your needs.
@Seldaek commented on GitHub (Nov 21, 2015):
There is no way and IMO it's out of scope for monolog, there are many existing solutions (although not in PHP that I know of), from Logstash to Heka to a zillion third party services that monolog supports logging to.