DokuWiki

It's better when it's simple

User Tools

Site Tools


Sidebar

Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community


Follow us on Facebook, Twitter and other social networks.

devel:debugging

Debug tools

DokuWiki has debugging tools. Some need to be configured.

Enable debugging

When config option allowdebug is enabled you can:

  • Appending ?do=debug or &do=debug to URL so DokuWiki will output a huge list of debug strings.
  • Look up output of dbglog() in data/cache/debug.log
  • Receive additional error messages e.g. from some authentication backends
  • Appending ?httpdebug or &httpdebug to URL to enable debugging output in DokuWiki's HTTPClient

Get page and user info

Appending ?do=check or &do=check to URL triggers the action mode check that provides some information about the users permissions and the DokuWiki setup.

Debugging indexer

See the debug info at the indexer page.

Debug functions

  • dbg($msg)
    Insert a code block in the wikipage filled by $msg as plain text.

    Adding an extra argument to dbg($msg, $hidden=true) will return the $msg as html comment.
  • dbglog($msg)
    Writes $msg to the log in the cache directory data/cache/debug.log when the config allowdebug is enabled. Be aware the log isn't emptied automatically.

    Use dbglog($msg, 'Header above log message') for including a header above $msg.
  • dbg_deprecated($alternative = '')
    Function to mark deprecated functions. Each call is logged to the debuglog, when the config allowdebug is enabled. The log message mentions: the name of the deprecated function, the function using it, its file and line and the $alternative when provided.
  • debug_guard($data)
    When you write your own debug functionality, use this function to remove all data from an array where the key seems to point to sensitive data.

See also

devel/debugging.txt · Last modified: 2016-03-21 16:52 by 141.79.68.27