Download the PHP package moktech/mocklogger-sdk without Composer
On this page you can find all versions of the php package moktech/mocklogger-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download moktech/mocklogger-sdk
More information about moktech/mocklogger-sdk
Files in moktech/mocklogger-sdk
Package mocklogger-sdk
Short Description Mocklogger SDK is a Laravel package designed to facilitate effortless integration with the Mocklogger logging tool for developers.
License MIT
Homepage https://github.com/Muchwat/mocklogger-sdk
Informations about the package mocklogger-sdk
MockLogger SDK Documentation
MockLogger SDK offers functionality for logging request and response data of a Laravel application. This SDK provides methods to capture and log data pertaining to incoming HTTP requests and their associated responses.
With the MockLogger SDK, you can easily capture and log data from HTTP requests and responses, helping you monitor and analyze your application's interactions with external services and users actions.
Installation
To get started with the MockLogger SDK, follow these installation steps:
Install the SDK:
Install the MockLogger SDK using Composer:
Publish Configuration:
Publish the MockLogger SDK configuration file using Artisan:
Register Service Provider:
Open the config/app.php
file and add the service provider to the providers array:
Set Environment Variables:
Set the following environment variables in your application's .env
. You can obtain these values from your Mocklogger application:
Usage
Once you have installed the MockLogger SDK and configured your environment, you can now use it to log request and response data. Here are two ways to use the SDK:
Method 1: Using sendLog
Use this in your Terminable Middleware (Sunctum protected URL).
Method 2: Using sendData
You can also manually assemble the request and response data and use the sendData method to log it.
Server Health Monitoring
MockLogger SDK empowers you to maintain optimal server performance by allowing you to set usage limits on CPU, memory, and hard disk space. If any of these limits are exceeded, the SDK automatically sends a detailed log to administrator's email configured in config/mocklogger.php
.
To start monitoring your server, run this command:
For continuous monitoring, you can schedule this command with a cron job. Keep your server in check effortlessly with this tool.