Download the PHP package vektormuhammadlutfi/codeigniter-log-viewer without Composer
On this page you can find all versions of the php package vektormuhammadlutfi/codeigniter-log-viewer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vektormuhammadlutfi/codeigniter-log-viewer
More information about vektormuhammadlutfi/codeigniter-log-viewer
Files in vektormuhammadlutfi/codeigniter-log-viewer
Package codeigniter-log-viewer
Short Description This is a simple Log Viewer for viewing Code Igniter 4 log files on the browser
License MIT
Informations about the package codeigniter-log-viewer
CodeIgniter Log Viewer with Composer
The CodeIgniter Log Viewer
package is a convenient library for viewing and managing log files in a CodeIgniter 4 application. It allows users to display logs, download log files, and perform other log-related operations easily.
A typical log view looks like this:
Requirements
- PHP 7.2 or later
- CodeIgniter 4
Installation via Composer
You can install the CodeIgniter Log Viewer
package using Composer, which is the recommended method for managing dependencies in CodeIgniter 4 applications.
-
Require the library via Composer by running the following command in your terminal:
-
Once the package is installed, you can load the
CILogViewer
class in your controller or any other place where you want to use it: -
Create a new instance of the
CILogViewer
class: -
Call the
showLogs
method to display the logs in the log viewer: - You can customize the behavior and appearance of the log viewer by modifying the configuration variables and view files as required.
Usage
To use the CodeIgniter Log Viewer
package in your CodeIgniter 4 application, follow these steps:
-
Make sure that the Composer autoloader is properly set up in your application. If you don't have an
index.php
file in your public directory, create one and add the following lines: -
Load the
CILogViewer
class in your controller or any other place where you want to use it: -
Create a new instance of the
CILogViewer
class: -
Call the
showLogs
method to display the logs in the log viewer: - You can customize the behavior and appearance of the log viewer by modifying the configuration variables and view files as required.
API Usage
The CodeIgniter Log Viewer
package also provides an API that allows you to programmatically access log files and perform operations.
-
To retrieve a list of log files, send a GET request to
/logs?api=list
. -
To view the logs of a specific file, send a GET request to
/logs?api=view&f=<file_name>
, where<file_name>
is the base64-encoded name of the log file. -
To delete a log file, send a GET request to
/logs?api=delete&f=<file_name>
, where<file_name>
is the base64-encoded name of the log file you want to delete. You can also use&f=all
to delete all log files. - Make sure to handle the JSON response from the API and display it appropriately in your application.
Contributing
Contributions to this project are highly welcomed! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.
License
This project is licensed under the MIT license.
Credits
- The
CodeIgniter Log Viewer
package is a refactor of the original library by Miguel Martinez. It is further developed and maintained by Muhammad Lutfi.
Resources
We hope you find the CodeIgniter Log Viewer
package helpful for accessing and managing log files in your CodeIgniter 4 application. If you have any questions or need further assistance, please don't hesitate to reach out!