joseph-holland / lambda-graffiti-monkey

An AWS Lambda function to run Graffiti Monkey
Apache License 2.0
15 stars 8 forks source link

Fix broken logging to CloudWatch Logs #3

Closed joseph-holland closed 7 years ago

joseph-holland commented 7 years ago

Need to update code to fix logging to CloudWatch Logs.

joseph-holland commented 7 years ago

Logging fixed. Issue was conflict with pre-existing log handler setup by Lambda. Just had to remove this and create our own which we can setup how we wish.

Some info on this can be found here and here.

Output from function in CloudWatch:

START RequestId: 638d4098-69c3-11e7-aaa5-732d50e57bec Version: $LATEST
2017-07-16 01:09:17,564 - root - INFO - Loading function
2017-07-16 01:09:17,564 - graffiti_monkey.core - INFO - Connecting to region eu-west-1 using profile None
2017-07-16 01:09:17,565 - graffiti_monkey.core - INFO - Getting list of all volumes
2017-07-16 01:09:17,648 - graffiti_monkey.core - INFO - Found 7 volumes
2017-07-16 01:09:17,649 - graffiti_monkey.core - INFO - Processing volume 1 of 7 total volumes
2017-07-16 01:09:17,649 - graffiti_monkey.core - INFO - Processing volume 2 of 7 total volumes
2017-07-16 01:09:17,681 - graffiti_monkey.core - INFO - Processing volume 3 of 7 total volumes
2017-07-16 01:09:17,712 - graffiti_monkey.core - INFO - Tagging vol-03f43484cf5acb019 with [Name: testname]
2017-07-16 01:09:17,832 - graffiti_monkey.core - INFO - Processing volume 4 of 7 total volumes
2017-07-16 01:09:17,832 - graffiti_monkey.core - INFO - Processing volume 5 of 7 total volumes
2017-07-16 01:09:17,832 - graffiti_monkey.core - INFO - Tagging vol-09048ab64b42fedb2 with [Name: testname]
2017-07-16 01:09:17,913 - graffiti_monkey.core - INFO - Processing volume 6 of 7 total volumes
2017-07-16 01:09:17,952 - graffiti_monkey.core - INFO - Tagging vol-054bef01058dc8754 with [Name: testname]
2017-07-16 01:09:18,044 - graffiti_monkey.core - INFO - Processing volume 7 of 7 total volumes
2017-07-16 01:09:18,045 - graffiti_monkey.core - INFO - Completed processing all volumes
2017-07-16 01:09:18,045 - graffiti_monkey.core - INFO - Getting list of all snapshots
2017-07-16 01:09:18,068 - graffiti_monkey.core - INFO - Found 0 snapshots
2017-07-16 01:09:18,069 - graffiti_monkey.core - INFO - Completed processing all snapshots
END RequestId: 638d4098-69c3-11e7-aaa5-732d50e57bec
REPORT RequestId: 638d4098-69c3-11e7-aaa5-732d50e57bec  Duration: 504.88 ms Billed Duration: 600 ms     Memory Size: 512 MB Max Memory Used: 24 MB