PHP code example of nzo / elk-bundle

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

    

nzo / elk-bundle example snippets


// config/bundles.php

return [
    // ...
    Nzo\UrlEncryptorBundle\NzoUrlEncryptorBundle::class => ['all' => true],
];

public function log()
{
    $context = [
        'name' => 'Wolverine',
        'username' => 'test',
        'email' => '[email protected]',
        'location' => [
            'address' => [
                'code' => '75000',
                'city' => 'Paris',
                'country' => 'France'
            ]
        ]
    ];

    $this->logger->error('Error', $context);
}

// The log output will be like:
[
    'name' => 'Wolverine',
    'username' => 'FbEtXzIRop0FFK31MdC+McgbWybD...',
    'email' => 'DNXDcuQDn7LbwlgLKnAgPsn...',
    'location' => [
        'address' => [
            'code' => 'FnzOIHjMZDzDmSSC...',
            'city' => 'pdjKJBDfd2Khdfkhbfk....',
            'country' => 'France'
        ]
    ]
]
 php
// config/bundles.php

return [
    // ...
    Nzo\ElkBundle\NzoElkBundle::class => ['all' => true],
];