DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:debugging

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
devel:debugging [2016-03-21 16:52] 141.79.68.27devel:debugging [2022-10-20 12:47] (current) Klap-in
Line 6: Line 6:
 When config option [[config:allowdebug]] is enabled you can: When config option [[config:allowdebug]] is enabled you can:
   * Appending ''?do=debug'' or ''&do=debug'' to URL so DokuWiki will output a huge list of debug strings.   * 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''+  * (//Up to Hogfather 2020 release//: Look up output of ''[[xref>dbglog()]]'' in ''data/cache/debug.log'')
   * Receive additional error messages e.g. from some authentication backends   * Receive additional error messages e.g. from some authentication backends
   * Appending ''?httpdebug'' or ''&httpdebug'' to URL to enable debugging output in DokuWiki's HTTPClient   * Appending ''?httpdebug'' or ''&httpdebug'' to URL to enable debugging output in DokuWiki's HTTPClient
 +  * Return some messages if stylesheets are missing
 +  * Receive additional comments in xhtml renderer output
 +  * Get some fallback try-catches in the compiled javascript file via ''js.php''
 +  * Get debugging at some other locations and in plugins or templates, see the codesearch for usage [[https://codesearch.dokuwiki.org/search?project=dokuwiki&project=plugin&project=template&full=allowdebug&path=-%22config%2Flang%22|allowdebug]]
  
 +===Enabling logging===
 +//Since Igor 2022 release//:
 +
 +DokuWiki has a logging functionality. Which information is not logged can be set with the [[config:dontlog]] config setting.
 +  * Default only //error// and //deprecated// messages are logged, and the //debug// log is disabled.
 +  * You can also enable //debug// log for more debug output
 +  * Via the admin interface you can use the [[plugin:LogViewer]]. If the LogViewer cannot be reached, you can find the log files in your file system in e.g. ''[wiki_folder]/data/log/error/<date>.log''.
  
 ===Get page and user info=== ===Get page and user info===
 Appending ''?do=check'' or ''&do=check'' to URL triggers the [[devel:action_modes#other_functions1|action mode check]] that provides some information about the users permissions and the DokuWiki setup.  Appending ''?do=check'' or ''&do=check'' to URL triggers the [[devel:action_modes#other_functions1|action mode check]] that provides some information about the users permissions and the DokuWiki setup. 
  
-===Debugging indexer=== +===Debugging TaskRunner === 
-See the [[:indexer#Debugging|debug info]] at the indexer page.+ 
 +See the [[:taskrunner#Debugging|debug info]] at the task runner page.
  
  
Line 22: Line 34:
   * **''[[xref>dbg|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.   * **''[[xref>dbg|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.
  
-  * **''[[xref>dbglog|dbglog($msg)]]''** \\ Writes $msg to the log in the cache directory ''data/cache/debug.log'' when the config [[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.+  * **''[[xref>dbglog|dbglog($msg)]]''** \\ Writes $msg to the //debug// log shown in [[plugin:LogViewer]], stored in ''[wiki_folder]/data/log/debug/<date>.log'' when ''debug'' is //un//checked in the [[config:dontlog]] setting.\\ (//Upto Hogfather 2020 release//: it wrote to the log in the cache directory ''data/cache/debug.log'' when the config [[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.
  
-  * **''[[xref>dbg_deprecated()|dbg_deprecated($alternative = '')]]''** \\ Function to mark deprecated functions. Each call is logged to the debuglog, when the config [[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.+  * **''[[xref>dbg_deprecated()|dbg_deprecated($alternative = '')]]''** \\ Function to mark deprecated functions. Each call is logged to the //deprecated// log shown in [[plugin:LogViewer]], when ''deprecated'' is unchecked in the [[config:dontlog]] setting. The log message mentions: the name of the deprecated function, the function using it, its file and line and the ''$alternative'' when provided.
  
   * **''[[xref>dbg_backtrace()]]''** \\ Print a reversed, prettyprinted backtrace   * **''[[xref>dbg_backtrace()]]''** \\ Print a reversed, prettyprinted backtrace
Line 30: Line 42:
   * **''[[xref>debug_guard|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.   * **''[[xref>debug_guard|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.
  
 +===== Sentry Plugin =====
 +
 +The [[plugin:sentry|Sentry Plugin]] allows you to log extensive information to the [[https://sentry.io|Sentry]] service. This is especially useful when running beta tests within a live environment.
  
  
Line 35: Line 50:
  
   * Configuration option [[config:allowdebug]]   * Configuration option [[config:allowdebug]]
 +  * Configuration option [[config:dontlog]] and [[plugin:LogViewer]] for the enabled logs
   * [[devel:Caching]]   * [[devel:Caching]]
 +  * I got a [[faq:blankpage|blank page]] or [[faq:error500|Error 500 (Internal Server Error)]]
 +
devel/debugging.1458575561.txt.gz · Last modified: 2016-03-21 16:52 by 141.79.68.27

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki