PHP code example of marciodojr / simple-logger

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

    

marciodojr / simple-logger example snippets


use Mdojr\Logger\SimpleLogger;
use Psr\Log\LogLevel;

$logger = new SimpleLogger();

$logger->log(LogLevel::ERROR, 'my log message'); // Log[error]: my log message
$logger->emergency(
    'emergency message {placeholder}', 
    ['placeholder' => 'with placeholders']
); // Log[emergency]: emergency message with placeholders

// ... any other log level specified by psr-3