PHP code example of artack / monolog-jira-handler

1. Go to this page and download the library: Download artack/monolog-jira-handler 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/ */

    

artack / monolog-jira-handler example snippets




$jiraHandler = new JiraHandler('your.jira.host', 'username', 'password', 'project = MYAPP AND resolution = Unresolved', 'Loghash', 'MYAPP', 'Bug', true, 'Logcount');

$loger = new Logger('name');
$loger->pushHandler($jiraHandler);

$loger->error('something went wrong...');



$jiraHandler = new JiraHandler('your.jira.host', 'username', 'password', 'project = MYAPP AND resolution = Unresolved', 'Loghash', 'MYAPP', 'Bug', true, 'Logcount');
$bufferHandler = new \Monolog\Handler\BufferHandler($jiraHandler);
$fingersCrossedHandler = new \Monolog\Handler\FingersCrossedHandler($bufferHandler);

$loger = new Logger('name');
$loger->pushHandler($fingersCrossedHandler);

// log records
$loger->debug('d1');
$loger->debug('d2');
$loger->debug('d3');
$loger->info('I am somehow nice to know');
$loger->error('something went wrong...');