Zum Ende der Metadaten springen
Zum Anfang der Metadaten

$url = LBWeb::loglist_url( @params );

 

Returns the URL to a webpage showing a list of your plugins logfiles. This function accepts parameters from LBLog / LoxBerry::Log to show all logfiles of your plugin, and also can filter to a log group name with the NAME parameter.

LoxBerry Compatibility

This function is available starting with LoxBerry V1.2.1. If you use that function, set this minimum version in your plugin.cfg.

This function only works for logfiles created by the PHP LBLog or the LoxBerry::Log Perl module. It does not work for individual logfiles not created by these modules.

The function returns a string with the URL to the loglist webpage. 

Without parameter, the url calls the loglist webpage with all logfiles of your plugin.

Using the NAME parameter, you can filter to specific Logfiles with the NAME log group. (e.g. if you created your log with 'name' =>'daemon').

To give parameters to the function, use an array with named parameters. To send an array, inside the brackets of the function parameters loglist_url() open and close the array with square brackets []. See the examples below.

Parameter

Case sensitivity

All parameter names are case-sensitive and written in capital letters.

ParameterOptionalUsage
NAMEx

NAME is the loggroup name used with LoxBerry::Log. If you have created a logfile with LoxBerry::Log::new( name => 'daemon'), use 'NAME' => 'daemon' to open the list filtered by name = daemon.

If you omit the NAME parameter, the link URL opens the loglist showing all logfiles of your plugin.

PACKAGEx

Package is not required in the case of a plugin. By default, this is (like with LoxBerry::Log) the $lbpplugindir-Variable.

Core-Developers have to use the PACKAGE parameter.

Return value

Returns a string that is the HTML code for the Loglist button. Simply echo the result of the function to your webpage.

Returns undef, if the call failed.

Usage

require_once "loxberry_web.php";

// Shows a link to a list of all logfiles of your plugin
$url = LBWeb::loglist_url();
echo "<a href='$url'>List my logfiles</a>";

// Show only logfiles LoxBerry::Log of a named group
$url = LBWeb::loglist_url ( ['NAME' => 'daemon'] );
echo "<a href='$url'>All daemon logfiles</a>";




  • Keine Stichwörter