PHP code example of blue32a / monolog-azure-blob
1. Go to this page and download the library: Download blue32a/monolog-azure-blob 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/ */
blue32a / monolog-azure-blob example snippets
$connection = 'DefaultEndpointsProtocol=https;AccountName=<name>;AccountKey=<key>';
$client = \MicrosoftAzure\Storage\Blob\BlobRestProxy::createBlobService($connection);
$logger = new \Monolog\Logger();
$handler = \Blue32a\Monolog\Handler\AzureBlobStorageHandler($client, 'container', 'append-blob.log');
$logger->pushHandler($handler);
// Write to Append Blob
$logger->info('Hello World!');