PHP code example of joppedc / logsnag-php-sdk

1. Go to this page and download the library: Download joppedc/logsnag-php-sdk 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/ */

    

joppedc / logsnag-php-sdk example snippets


new JoppeDc\LogsnagPhpSdk\Client("your_secret_key");

$payload = new JoppeDc\LogsnagPhpSdk\Contracts\LogPayload(
    'project_name',
    'channel_name',
    'event_name'
);

$payload->setDescription('test-description');
$payload->setTags(['tag' => 'tag value']);
$payload->setIcon('😀');

$log = $this->client->createLog($payload);

$payload = new JoppeDc\LogsnagPhpSdk\Contracts\InsightPayload(
    'project_name',
    'title',
    5
);

$payload->setIcon('😀');

$insight = $this->client->createInsight($payload);

$payload = new JoppeDc\LogsnagPhpSdk\Contracts\MutateInsightPayload(
    'project_name',
    'title',
    -5
);

$payload->setIcon('😀');

$insight = $this->client->mutateInsight($payload);
bash
composer 
bash
composer