ianm / log-viewer
Easily view your Flarum logfiles from within the admin interface
Installs: 3 084
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 1
Type:flarum-extension
Requires
- flarum/core: ^1.2.0
Requires (Dev)
- flarum/testing: ^1.0.0
- symfony/var-dumper: *
This package is auto-updated.
Last update: 2024-10-25 01:07:00 UTC
README
Easily view your Flarum logfiles from within the admin interface.
This utility extension offers access to Flarum's logfiles without the need for command line access to your server. It exposes the contents of files found in the {flarum_install_dir}/storage/logs
directly to the admin interface, or optionally via the API.
This is especially useful if you have either limited knowledge of SSH
access/commands, or you are using a host where this is simply not permitted. So long as the Flarum logger
has not been modified to store logs elsewhere (usually only on multi-instance, scalable hosting solutions), then this extension will work for you!
Need to access the logs in order to troubleshoot a problem you're having with your forum? Simply login as an admin account and look for any trouble signs in the log viewer. Simple, just be sure to review any log snippets you share with others, as they may contain sensitive data.
Subject to the Flarum scheduler being active, logfiles are purged from you log
folder once they are more than 90 days old. A setting is provided to adjust this up/down to suit your requirements. A value of 0
will disable purging.
Screenshots
API Usage
Two API endpoints are provided to enable the logs to be easily extracted from Flarum into another system. Permissions to access these endpoints are provided, and restriced to admin
users only by default, although you may create a dedicated permission group and apply log access to that group as well for log retrieval without full admin permissions. NEVER GRANT LOG ACCESS TO REGULAR USERS.
Permission can be set within the extension page, or the global Permissions
tab
Once authenticated, a GET
request can be made to /api/logs
to list the available log files.
To retrieve a particular file, another GET
request should be made to /api/logs/{filename}
Future changes/features
- Add option to download a file from the admin interface
- Add option to delete a file from the admin interface
- Add feature to tail new logfile content and stream this into the viewer
Installation
Install with composer:
composer require ianm/log-viewer
Updating
composer update ianm/log-viewer php flarum cache:clear