maxbanton / cwh

Amazon Web Services CloudWatch Logs Handler for Monolog library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cloudwatch Dashboard

kareemashraf opened this issue · comments

so im using the following code
`
use Aws\CloudWatchLogs\CloudWatchLogsClient;
use Maxbanton\Cwh\Handler\CloudWatch;
use Monolog\Logger;

$sdkParams = [
'region' => 'eu-west-1',
'version' => 'latest',
'credentials' => [
'key' => 'my AWS key',
'secret' => 'my AWS secret',
'token' => '', // token is optional
]
];

// Instantiate AWS SDK CloudWatch Logs Client
$client = new CloudWatchLogsClient($sdkParams);

// Log group name, will be created if none
$groupName = 'php-logtest';

// Log stream name, will be created if none
$streamName = 'ec2-instance-1';

// Days to keep logs, 14 by default. Set to null to allow indefinite retention.
$retentionDays = 30;

// Instantiate handler (tags are optional)
$handler = new CloudWatch($client, $groupName, $streamName, $retentionDays, 10000, ['my-awesome-tag' => 'tag-value']);
`

but then how can i get the values of a specific cloudwatch Dashboard that i have in my account using the library ?

Regards,

Hi @kareemashraf.

I guess CloudWatch Dashboards topic is not related to the handler.

Please read the documentation about Dashboards https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html
Also there are some useful information in the Internet http://bfy.tw/JvKA