Download the PHP package ahost/logging without Composer
On this page you can find all versions of the php package ahost/logging. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ahost/logging
More information about ahost/logging
Files in ahost/logging
Package logging
Short Description Create & save log file and store data in database
License MIT
Informations about the package logging
Lumen Log Viewer
Save log file and store log data in database , along with Log Viewer view which can access directly through package's route.
Installation
-
ใช้คำสั่ง composer require ใน terminal เพื่อติดตั้ง package
-
เพิ่ม Service Provider ในไฟล์
bootstrap/app.php
ในส่วนของproviders
-
เปิดคอมเม้นท์
withFacades()
และwithEloquent()
ในไฟล์bootstrap/app.php
- รันคำสั่ง custom command ของ package เพื่อทำการตั้งค่าไฟล์ต่างๆโดยอัตโนมัติ ดังนี้
Usage
- เพิ่มคำสั่ง
use Ahost\Logging\BaseLogger;
ในไฟล์ controller ที่ต้องการใช้งานฟังก์ชันของ package -
สร้าง variable ที่สืบทอดฟังก์ชันของ class baselogger ในไฟล์ controller ที่ต้องการ ยกตัวอย่างเช่น
-
เรียกใช้ฟังก์ชัน init() ผ่าน variable ที่สืบทอด class baselogger (เพื่อทำการตั้งค่า path ของ log file)
-
เรียกใช้ฟังก์ชันของ baselogger ผ่าน variable ในส่วนที่ต้องการเก็บข้อความ log ยกตัวอย่างเช่น
- สามารถเข้าดูหน้า Log Viewer ได้ผ่าน
http://.../log/view