PHP code example of acplo / acplolog

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

    

acplo / acplolog example snippets


    
    return array(
        'modules' => array(
            'AcploLog',
            'Application'
        ),
        'module_listener_options' => array(
            'config_glob_paths'    => array(
                'config/autoload/{,*.}{global,local}.php',
            ),
            'module_paths' => array(
                './module',
                './vendor',
            ),
        ),
    );
    

chdir(dirname(__DIR__));

::registerHandlers();

Zend\Mvc\Application::init(

AcploLog\Log\ErrorLogger::registerHandlers();

echo \AcploLog\Log\EntityLogger::dump($entity);

public static function dump($entity, $maxDepth = 1, $toHtml = true)

echo \AcploLog\Log\EntityLogger::dump($entity, 2);

echo \AcploLog\Log\EntityLogger::dump($entity, 3);

namespace App;
return array(
    // Doctrine config
    'doctrine' => array(
        'driver' => array(
            __NAMESPACE__ . '_driver' => array(
                'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
                'cache' => 'array',
                'paths' => array(
                    __DIR__ . '/../src/' . __NAMESPACE__ . '/Entity'
                )
            ),
            'orm_default' => array(
                'drivers' => array(
                    __NAMESPACE__ . '\Entity' => __NAMESPACE__ . '_driver'
                )
            )
        ),
        'eventmanager' => array(
            'orm_default' => array(
                'subscribers' => array(
                    'AcploLog\Log\EntityLogger'
                )
            )
        )
    )
);

AcploLog\Log\StaticLogger::save("Test message");
AcploLog\Log\StaticLogger::save("Test message 2", 'test.log');

AcploLog\Log\StaticLogger::save($myObj);

$logger = $sm->get('AcploLog\Log\StaticLogger');
$logger->debug("Test message");

AcploLog\Log\StaticLogger::save("Test message", null);

ls /usr/local/zend/var/zray/extensions/AcploLog/
logo.png	zray.php