1. Go to this page and download the library: Download folded/log library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
folded / log example snippets
use function Folded\addLogger;
use function Folded\addDebugLog;
addLogger("myLogger", "file", [
"path" => __DIR__ . "/logs/my-file.log",
]);
addDebugLog("myLogger", "This is my first debug log!");
use function Folded\addLogger;
use function Folded\addDebugLog;
use const Folded\CHANNEL_FILE;
addLogger("myLogger", CHANNEL_FILE, [
"path" => __DIR__ . "/logs/my-file.log",
]);
addDebugLog("myLogger", "This is my first debug log!");
use const Folded\CHANNEL_FILE;
use function Folded\addLogger;
use function Folded\addDebugLog;
addLogger("myLogger", "file", [
"path" => __DIR__ . "/logs/my-file.log",
]);
addDebugLog("myLogger", "a user has registered", [
"timestamp" => 1577836800,
]);
use function Folded\addLogger;
use function Folded\addLog;
addLogger("myLogger", "file", [
"path" => __DIR__ . "/logs/neutral.log",
]);
addLog("myLogger", "warning", "User email invalid");
use function Folded\addLogger;
use function Folded\addLog;
use const Folded\SEVERITY_WARNING;
addLogger("myLogger", "file", [
"path" => __DIR__ . "/logs/neutral.log",
]);
addLog("myLogger", SEVERITY_WARNING, "User email invalid");
use const Folded\SEVERITY_ALERT;
use const Folded\SEVERITY_CRITICAL;
use const Folded\SEVERITY_DEBUG;
use const Folded\SEVERITY_EMERGENCY;
use const Folded\SEVERITY_ERROR;
use const Folded\SEVERITY_INFO;
use const Folded\SEVERITY_NOTICE;
use const Folded\SEVERITY_WARNING;
use function Folded\addLogger;
use function Folded\addLoggerChannel;
addLogger("myLogger");
// First file
addLoggerChannel("myLogger", "file", [
"path" => "path/to/file-1.log",
]);
// Second file
addLoggerChannel("myLogger", "file", [
"path" => "path/to/file-2.log",
]);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.