Title: WP Log Action
Author: webheadcoder
Published: <strong>2016 年 10 月 4 日</strong>
Last modified: 2025 年 5 月 6 日

---

搜索插件

![](https://s.w.org/plugins/geopattern-icon/wp-log-action.svg)

# WP Log Action

 作者：[webheadcoder](https://profiles.wordpress.org/webheadllc/)

[下载](https://downloads.wordpress.org/plugin/wp-log-action.0.54.zip)

 * [详情](https://cn.wordpress.org/plugins/wp-log-action/#description)
 * [评价](https://cn.wordpress.org/plugins/wp-log-action/#reviews)
 * [开发进展](https://cn.wordpress.org/plugins/wp-log-action/#developers)

 [支持](https://wordpress.org/support/plugin/wp-log-action/)

## 描述

This plugin uses hooks in the opposite way most plugins do. You add `do_action` 
where you want to do some logging and this plugin will save it to the database only
when active.

#### Log Activity

This plugin now logs plugin activity (when activated, deactivated, deleted, updated,
installed), when wordpress is updated, and when functions are used wrong or deprecated.

Example:

    ```
    do_action( 'wp_log_info', 'So far ok', 'Details of what is ok.' );
    if ( $something_bad_happened ) {
        do_action( 'wp_log_error', 'This Happened!', 'Details of what happened.' );
        ...
    }
    ```

See Tools->Logs to view, delete, and export the logs on the admin side. Only users
with the manage_options capability will have access.

This plugin automatically logs deprecated and doing_it_wrong errors. The rest is
what you add to your code.

You can log what functions will be run for a specific action or filter. For example
if you want to see what runs in the ‘init’ hook:

    ```
    function check_init_hook() {
        do_action( 'wp_log_debug_hook', 'init' );
    }
    add_filter( 'init', 'check_init_hook', 0 );
    ```

The following are the different levels of logging to add to your code. You can use
any level how you see fit, the descriptions of each level are just guidelines.

#### Emergency

System is unusable
 do_action( ‘wp_log_emergency’, $label, $message );

#### Alert

Action must be taken immediately.
 do_action( ‘wp_log_alert’, $label, $message );

#### Critical

Critical conditions.
 do_action( ‘wp_log_critical’, $label, $message );

#### Error

Runtime errors that do not require immediate action but should typically be logged
and monitored.
 do_action( ‘wp_log_error’, $label, $message );

#### Warning

Exceptional occurrences that are not errors.
 do_action( ‘wp_log_warning’, $label,
$message );

#### Notice

Normal but significant events.
 do_action( ‘wp_log_notice’, $label, $message );

#### Info

Interesting events.
 do_action( ‘wp_log_info’, $label, $message );

#### Debug

Detailed debug information.
 do_action( ‘wp_log_debug’, $label, $message );

## 评价

![](https://secure.gravatar.com/avatar/3bc838609d594e5354565af940cac3f81f267b0d8e6f3d3498660e4aff8717a3?
s=60&d=retro&r=g)

### 󠀁[Great Plugin](https://wordpress.org/support/topic/greta-plugin-5/)󠁿

 [mungle](https://profiles.wordpress.org/mungle/) 2016 年 10 月 17 日

Simple, easy and powerful! Love it!

 [ 阅读所有1条评价 ](https://wordpress.org/support/plugin/wp-log-action/reviews/)

## 贡献者及开发者

「WP Log Action」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ webheadcoder ](https://profiles.wordpress.org/webheadllc/)

[帮助将「WP Log Action」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/wp-log-action)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/wp-log-action/)，查看
[SVN仓库](https://plugins.svn.wordpress.org/wp-log-action/)，或通过[RSS](https://plugins.trac.wordpress.org/log/wp-log-action/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/wp-log-action/)。

## 更新日志

#### 0.54

Fixed cron job not running.
 Updated delete function.

#### 0.53

Security enhancements.

#### 0.51

Fixed timezone error.
 Fixed PHP warnings.

#### 0.50

Added automatic deleting of logs based on options.
 By default, logs will be deleted
12 months after its created. Existing users need to re-save their settings or reactivate
the plugin.

#### 0.40

Added logging when plugin and core are updated.

#### 0.34

Fixed silly microsoft bug by making the ID column name lower case in export. Thanks
to @clratliff for letting me know!

#### 0.33

Fixed exporting of logs.

#### 0.32

Updated delete to use POST instead of GET.
 Fixed pages displaying all rows instead
of just 25 rows.

#### 0.31

Fixed search losing parameters when going to the next page on view log screen.

#### 0.3

Added Export Results option in Bulk Actions.

#### 0.22

Fix option name not defined.

#### 0.21

Fix css and js not loading.
 Add options page.

#### 0.2

Change default order of table to descending.
 Print arrays so it’s readable even
though it’s ugly. Update readme.

#### 0.1

Initial release.

## 额外信息

 *  版本 **0.54**
 *  最后更新：**12 月前**
 *  活跃安装数量 **30+**
 *  WordPress 版本 ** 5.3 或更高版本 **
 *  已测试的最高版本为 **6.8.5**
 *  语言
 * [English (US)](https://wordpress.org/plugins/wp-log-action/)
 * 标签
 * [activity](https://cn.wordpress.org/plugins/tags/activity/)[debug](https://cn.wordpress.org/plugins/tags/debug/)
   [developer tool](https://cn.wordpress.org/plugins/tags/developer-tool/)[log](https://cn.wordpress.org/plugins/tags/log/)
   [warning](https://cn.wordpress.org/plugins/tags/warning/)
 *  [高级视图](https://cn.wordpress.org/plugins/wp-log-action/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  1 条 5 星评价     ](https://wordpress.org/support/plugin/wp-log-action/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/wp-log-action/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/wp-log-action/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/wp-log-action/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/wp-log-action/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/wp-log-action/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/wp-log-action/reviews/)

## 贡献者

 *   [ webheadcoder ](https://profiles.wordpress.org/webheadllc/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/wp-log-action/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://webheadcoder.com/donate-wp-log-action)