[WordPress] 外掛分享: MSBD Logs

首頁外掛目錄 › MSBD Logs
WordPress 外掛 MSBD Logs 的封面圖片
全新外掛
安裝啟用
尚無評分
75 天前
最後更新
問題解決
WordPress 5.5+ PHP 7.4+ v1.0.2 上架:2026-01-26

內容簡介

**總結:**
MSBD Logs 是一款 WordPress 外掛,讓開發者能夠查看和管理由外掛程式和主題產生的日誌檔案。這是為 WordPress 外掛和主題開發者設計的輕量日誌輔助程式,提供簡單的 PHP API 寫入日誌訊息以及管理介面來查看、過濾和管理儲存在 WordPress 上傳目錄中的日誌檔案。

**問題與答案:**
1. MSBD Logs 是什麼樣的外掛?
- MSBD Logs 是一款 WordPress 外掛,讓開發者能夠查看和管理外掛程式和主題產生的日誌檔案。

2. 開發者可以如何在外掛或主題程式碼中使用 MSBD Logs 的功能?
- 開發者可以在外掛或主題程式碼中使用以下幫助函數:
- `msbd_logs_create( 'Log something only when the debug mode is active' );`
- `msbd_logs_create( 'Unexpected issue detected, always log', 'attention' );`
- Debug 日誌僅在啟用偵錯模式時寫入,注意日誌則一直被寫入。

3. 啟動後在 WordPress 管理員儀表板中會出現什麼新的選單項目?
- 啟動後,將出現一個名為「MSBD Logs」的新選單項目。從此畫面,管理員可以查看可用的日誌檔案、按檔名過濾日誌檔案、檢查日誌檔案內容以及啟用或停用偵錯日誌功能。

4. 日誌檔案儲存在什麼位置?
- 所有日誌檔案均儲存在 `wp-content/uploads/logs/` 資料夾中。在啟動外掛時,在 `wp-content/uploads/` 中會創建一個 logs 資料夾。為了防止目錄瀏覽,系統會自動建立一個 index.html 檔案。

5. MSBD Logs 外掛提供了哪些主要功能?
- 簡單的開發人員日誌功能
- 每日輪替的日誌檔案
- 分開的日誌類型:debug 和 attention
- 從管理介面可以啟用或停用偵錯日誌功能
- 管理介面可查看和過濾日誌檔案
- 安全的檔案處理(具有能力和 nonce 保護)
- 沒有資料庫表格或外部服務
- 可進行翻譯。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「MSBD Logs」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

MSBD Logs is a WordPress plugin that allows developers to review and manage log files generated by plugins and themes.
MSBD Logs is a lightweight logging helper for WordPress plugin and theme developers.
It provides a simple PHP API to write log messages and an admin interface to view, filter, and manage log files stored in the WordPress uploads directory.
The plugin is designed to be minimal, dependency-free, and safe for use on production sites.
🎉 Key Features

Simple logging function for developers
Daily rotating log files
Separate log types: debug and attention
Debug logging can be enabled or disabled from admin
Admin UI to view, and filter log files
Secure file handling (capability and nonce protected)
No database tables or external services
Translation-ready

Log Storage Location
All log files are stored in: wp-content/uploads/logs/. logs folder is created in wp-content/uploads/ on activating the plugin. An index.html file is automatically created to prevent directory browsing.
Developer Usage
Use the following helper function anywhere in your plugin or theme code:
* msbd_logs_create( 'Log something only when the debug mode is active' );
* msbd_logs_create( 'Unexpected issue detected, always log', 'attention' );
* debug logs are written only when debug mode is enabled
* attention logs are always written
Admin Interface
After activation, a new menu item “MSBD Logs” appears in the WordPress admin dashboard.
From this screen, administrators can:

View available log files
Filter log files by filename
Inspect log file contents
Enable or disable debug logging

Only users with the manage_options capability can access the interface.
Standalone & Compatible
MSBD Logs works fully as a standalone plugin.
If other MSBD-related plugins are installed in the future, menu grouping can be handled automatically without affecting functionality.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon