PHP code example of phramework / system-log

1. Go to this page and download the library: Download phramework/system-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/ */

    

phramework / system-log example snippets



use \Phramework\Phramework;
use \Phramework\SystemLog;

$settings = [
    'system-log' => [
        'log' => '\\Phramework\\SystemLog\\Log\\TerminalLog',
        'matrix' => [
            'Me\\APP\\Controllers\\DummyController::GET'
                =>    SystemLog::LOG_REQUEST_HEADER_AGENT
                    | SystemLog::LOG_REQUEST_PARAMS
        ],
        'matrix-exception' => [
            'Exception'
                =>    SystemLog::LOG_STANDARD,
            'Phramework\\Exceptions\\ServerException'
                =>    SystemLog::LOG_REQUEST_HEADER_AGENT
                    | SystemLog::LOG_REQUEST_PARAMS
                    | SystemLog::LOG_RESPONSE_BODY
                    | SystemLog::LOG_REQUEST_HEADERS
        ]
    ]
];

$phramework = new Phramework(
    $settings,
    new \Phramework\URIStrategy\URITemplate([])
);

$systemLog = new SystemLog($settings['system-log']);
$systemLog->register();

$phramework->invoke();