Title: Hagakure &#8211; Yet Another Error Reporter
Author: Tarosky Inc.
Published: <strong>10. 5. 2019</strong>
Last modified: 4. 6. 2026

---

Prohledat pluginy

![](https://ps.w.org/hagakure/assets/banner-772x250.png?rev=3560980)

![](https://ps.w.org/hagakure/assets/icon-256x256.png?rev=3560980)

# Hagakure – Yet Another Error Reporter

 Autor: [Tarosky Inc.](https://profiles.wordpress.org/tarosky/)

[Stáhnout](https://downloads.wordpress.org/plugin/hagakure.1.3.3.zip)

 * [Podrobnosti](https://cs.wordpress.org/plugins/hagakure/#description)
 * [Hodnocení](https://cs.wordpress.org/plugins/hagakure/#reviews)
 *  [Instalace](https://cs.wordpress.org/plugins/hagakure/#installation)
 * [Vývojáři](https://cs.wordpress.org/plugins/hagakure/#developers)

 [Podpora](https://wordpress.org/support/plugin/hagakure/)

## Popis

Have you ever seen an error log like the one below?

> PHP Fatal error: Allowed memory size of xxxxxx bytes exhausted (tried to allocate
> xxx bytes) in /var/www/wordpress/wp-includes/wp-db.php on line 2007

This means that [PHP memory limit](https://www.php.net/manual/en/ini.core.php#ini.memory-limit)
is exhausted while retrieving data from a database. In any case, this happens when
your site has big data and makes insane loops inside.

But we want to know that **which plugin tried to retrieve data?**

Hagakure adds extra information to error.log file when `wp-db.php` causes memory
limit error:

    ```
    [08-May-2019 10:28:37 UTC] wpdb Error Backtrace:
    #1      Kunoichi\Hagakure\DbLogger->filter_query()      /app/public/wp-includes/class-wp-hook.php       Line 286
    #2      WP_Hook->apply_filters()        /app/public/wp-includes/plugin.php      Line 208
    #3      apply_filters   /app/public/wp-includes/wp-db.php       Line 1871
    #4      wpdb->query()   /app/public/wp-includes/wp-db.php       Line 2579
    #5      wpdb->get_results()     /app/public/wp-includes/class-wp-query.php      Line 2979
    #6      WP_Query->get_posts()   /app/public/wp-includes/class-wp-query.php      Line 3387
    #7      WP_Query->query()       /app/public/wp-includes/post.php        Line 1961
    #8      get_posts       /app/public/wp-content/plugins/hagakure/hagakure.php    Line 34
    #9      {closure}       /app/public/wp-includes/class-wp-hook.php       Line 286
    #10     WP_Hook->apply_filters()        /app/public/wp-includes/class-wp-hook.php       Line 310
    #11     WP_Hook->do_action()    /app/public/wp-includes/plugin.php      Line 465
    #12     do_action       /app/public/wp-includes/template-loader.php     Line 13
    #13     require_once    /app/public/wp-blog-header.php  Line 19
    #14     require /app/public/index.php   Line 17
    #15     URI: /?p=1
    ```

This log will always follow the memory limit Fatal Error by `wp-db.php`. Now you
can find `#8` calls `get_posts` repeatedly.

We recommend watching logs with notification services like [CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html).

This error occurs in the productional environment, and you may not have a chance
to see it occurs. We use Hagakure with our [hosting service](https://hosting.kunoichiwp.com/),
please look forward to seeing [our blog published](https://kunoichiwp.com/blog) 
and describing the integration!

This plugin also adds debug backtrace to error logs. To modify the error level to
a detailed backtrace, define the constant in `wp-config.php` or somewhere else:

    ```
    define( 'HAGAKURE_ERROR_LEVEL', E_NOTICE | E_USER_WARNING | E_WARNING | E_USER_ERROR );
    ```

Besides that, if `SAVEQUERIES` is set `true`, the slow query log will be logged 
with PHP debug backtrace. This helps you to debug.

### Acknowledgements

The base text for dummy content is „Three Ghost Story“ by Charles Dickens. The text
file is modified the one of [Project Gutenberg](https://www.gutenberg.org/ebooks/1289).

## Instalace

#### Requirements

 * WordPress 5.9 or later.
 * PHP 7.4 or later. Tested and supported on PHP 7.4, 8.0, 8.2 and 8.3.

#### Steps

 1. Upload `hagakure` folder to the `/wp-content/plugins` directory.
 2. Activate the plugin through the ‚Plugins‘ menu in WordPress.
 3. That’s it. This plugin will work as background.

## Nejčastější dotazy

### Does this plugin support PHP 8.x?

Yes. Hagakure requires PHP 7.4 or later and is tested against PHP 7.4, 8.0, 8.2 
and 8.3 in CI.

### How can I contribute?

We host this plugin on GitHub [tarosky/hagakure](https://github.com/tarosky/hagakure).
Please feel free to send [PRs](https://github.com/tarosky/hagakure/pulls) or to 
make [issues](https://github.com/tarosky/hagakure/issues).

## Recenze

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

### 󠀁[Great](https://wordpress.org/support/topic/great-9698/)󠁿

 [horike](https://profiles.wordpress.org/horike/) 10. 5. 2019

This plugin makes it easy to find the root cause of PHP Fatal error: Allowed memory
size of xxxxxx bytes exhausted error. AWESOME.

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

### 󠀁[Looks good](https://wordpress.org/support/topic/looks-good-108/)󠁿

 [Takayuki Miyauchi](https://profiles.wordpress.org/miyauchi/) 10. 5. 2019

Works like a charm. 🙂

 [ Přečtěte si všechny 2 recenze ](https://wordpress.org/support/plugin/hagakure/reviews/)

## Autoři

Hagakure – Yet Another Error Reporter je otevřený software. Následující lidé přispěli
k vývoji tohoto pluginu.

Spolupracovníci

 *   [ Tarosky Inc. ](https://profiles.wordpress.org/tarosky/)
 *   [ Fumiki Takahashi ](https://profiles.wordpress.org/takahashi_fumiki/)
 *   [ Kunoichi INC ](https://profiles.wordpress.org/kuno1/)

Plugin „Hagakure – Yet Another Error Reporter“ byl přeložen do 1 jazyku. Děkujeme
všem [překladatelům](https://translate.wordpress.org/projects/wp-plugins/hagakure/contributors)
za jejich pomoc.

[Přeložte “Hagakure – Yet Another Error Reporter” do svého jazyka.](https://translate.wordpress.org/projects/wp-plugins/hagakure)

### Zajímá vás vývoj?

[Prohledejte kód](https://plugins.trac.wordpress.org/browser/hagakure/), podívejte
se do [SVN repozitáře](https://plugins.svn.wordpress.org/hagakure/), nebo se přihlaste
k[ odběru protokolu vývoje](https://plugins.trac.wordpress.org/log/hagakure/) pomocí
[RSS](https://plugins.trac.wordpress.org/log/hagakure/?limit=100&mode=stop_on_copy&format=rss).

## Přehled změn

#### 1.3.3

 * Respect the error suppression operator(@) and `error_reporting()` so that intentionally
   suppressed errors (e.g. `EINTR` from blocking socket functions) are no longer
   logged.

#### 1.3.2

 * Display only the request URI for non-DB errors in the error log.

#### 1.3.1

 * Bump required PHP and WP version.
 * Fix memory limit error log logic.
 * Move the ownership to TAROSKY Inc from Kunoichi Inc. Tarosky is a parent company
   of Kunoichi Inc. Developers are the same ☺️

#### 1.2.0

 * Slow query can be logged with the backtraces.

#### 1.1.0

 * Add Request URI to backtrace.

#### 1.0.0

 * Add warning and notice detail handler.

#### 0.8.0

 * First Release.

## Meta

 *  Verze **1.3.3**
 *  Poslední aktualizace **před 4 měsíce**
 *  Aktivních instalací **30+**
 *  Verze WordPressu ** 5.9 nebo novější **
 *  Testováno až do WordPressu **7.0.6**
 *  Verze PHP ** 7.4 nebo novější **
 *  Jazyky
 * [English (US)](https://wordpress.org/plugins/hagakure/) a [Japanese](https://ja.wordpress.org/plugins/hagakure/).
 *  [Přeložte do vašeho jazyka](https://translate.wordpress.org/projects/wp-plugins/hagakure)
 * Štítků
 * [backtrace](https://cs.wordpress.org/plugins/tags/backtrace/)[debug](https://cs.wordpress.org/plugins/tags/debug/)
   [error](https://cs.wordpress.org/plugins/tags/error/)[error log](https://cs.wordpress.org/plugins/tags/error-log/)
   [slow-query](https://cs.wordpress.org/plugins/tags/slow-query/)
 *  [Podrobnosti](https://cs.wordpress.org/plugins/hagakure/advanced/)

## Hodnocení

 5 z 5 hvězdiček.

 *  [  2 5hvězdičkové hodnocení     ](https://wordpress.org/support/plugin/hagakure/reviews/?filter=5)
 *  [  0 4hvězdičkové hodnocení     ](https://wordpress.org/support/plugin/hagakure/reviews/?filter=4)
 *  [  0 3hvězdičkové hodnocení     ](https://wordpress.org/support/plugin/hagakure/reviews/?filter=3)
 *  [  0 2hvězdičkové hodnocení     ](https://wordpress.org/support/plugin/hagakure/reviews/?filter=2)
 *  [  0 1hvězdičkové hodnocení     ](https://wordpress.org/support/plugin/hagakure/reviews/?filter=1)

[Vaše hodnocení](https://wordpress.org/support/plugin/hagakure/reviews/#new-post)

[Zobrazit všechny recenze](https://wordpress.org/support/plugin/hagakure/reviews/)

## Spolupracovníci

 *   [ Tarosky Inc. ](https://profiles.wordpress.org/tarosky/)
 *   [ Fumiki Takahashi ](https://profiles.wordpress.org/takahashi_fumiki/)
 *   [ Kunoichi INC ](https://profiles.wordpress.org/kuno1/)

## Podpora

Potřebujete pomoc?

 [Fórum podpory](https://wordpress.org/support/plugin/hagakure/)