WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/log app

This article is a ROUGH DRAFT. The author is still working on this document, so please do not edit this without the author's permission. The content within this article may not yet be verified or valid. This information is subject to change.

Contents

Description

Logs messages to a file.

You can log all atom actions within wordpress by simply calling this function

Usage

<?php log_app$label$msg?>


Parameters

$label
(string) (required) Type of logging to be done.
Default: None
$msg
(string) (required) Information describing the type of logging being done.
Default: None


Examples

Assuming we're within one the wp-app.php

//  This would log that the function get_service was called
function get_service() {
   log_app('function','get_service()');
}

Notes

In order for logging to work, you will need to edit wp_app.php and modify the global variable app_logging line 32 from:

/**
 * Whether to enable Atom Publishing Protocol Logging.
 *
 * @name app_logging
 * @var int|bool
 */
$app_logging = 0;

to:

/**
 * Whether to enable Atom Publishing Protocol Logging.
 *
 * @name app_logging
 * @var int|bool
 */
$app_logging = 1;

Source File

log_app() is located in wp-app.php.