
內容簡介
這是一個用於 WordPress 網站偵錯紀錄的外掛。
如何使用?
使用此函式來紀錄日誌。
// 變數的值可以是字串、陣列或物件
$variable = 'Variable value';
// 日誌文件的位置在 /wp-content/plugins/samudra-log/log/sd_log.log
sd_log($variable);
// 日誌文件的位置在 /wp-content/plugins/samudra-log/log/my-file.log
sd_log($variable, 'my-file');
限制直接存取日誌文件
如果您使用 Nginx,請將此代碼放置在您的 server block 內。
location ~ /wp-content/plugins/samudra-log/log/.*\.log$ {
deny all;
return 404;
}
外掛標籤
開發者團隊
原文外掛簡介
Write log for debugging WordPress site.
How to Use?
Use this function to write log.
// Variable value can be string, array, or object
$variable = 'Variable value';
// Log file will be in /wp-content/plugins/samudra-log/log/sd_log.log
sd_log($variable);
// Log file will be in /wp-content/plugins/samudra-log/log/my-file.log
sd_log($variable, 'my-file');
Restrict direct access to log file
If you are using Nginx, put this code inside your server block.
location ~ /wp-content/plugins/samudra-log/log/.*\.log$ {
deny all;
return 404;
}
