Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHCLOUD-4283 - Enabling stdout logs #650

Merged
merged 25 commits into from
Jul 7, 2020
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f150695
rebasing
tahmidefaz May 1, 2020
4d83a84
using logconfig as default log_config_file
tahmidefaz May 4, 2020
f4d5bc2
Merge branch 'master' into stdout-logging
tahmidefaz May 4, 2020
afca122
Merge remote-tracking branch 'origin' into stdout-logging
tahmidefaz May 22, 2020
c983e0c
resolving conflicts
tahmidefaz May 22, 2020
e693f88
applying suggestions
tahmidefaz May 27, 2020
8e61d98
fixing cloudwatch logs
tahmidefaz May 28, 2020
188767e
Merge branch 'master' into stdout-logging
shdunning Jun 4, 2020
5a794b3
cloudwatch working without global vars :tada:
tahmidefaz Jun 15, 2020
9292e45
Merge branch 'master' into stdout-logging
tahmidefaz Jun 15, 2020
8a9a754
Merge branch 'master' into stdout-logging
Glutexo Jun 24, 2020
dfc53ba
Merge branch 'master' into stdout-logging
Glutexo Jun 29, 2020
3f29d5f
Stdout logging (#673)
tahmidefaz Jul 1, 2020
adc7f91
remove cw handler if creds not present
tahmidefaz Jul 2, 2020
6a0bd5b
freaking lint :man_facepalming:
tahmidefaz Jul 2, 2020
4dee8cb
reverting
tahmidefaz Jul 2, 2020
c7bda5e
reverting
tahmidefaz Jul 2, 2020
36895ea
fix
tahmidefaz Jul 2, 2020
060c8a5
Merge branch 'master' into stdout-logging
tahmidefaz Jul 2, 2020
68dd40a
deleting logconfig.ini
tahmidefaz Jul 2, 2020
a824ae5
Merge branch 'stdout-logging' of github.com:RedHatInsights/insights-h…
tahmidefaz Jul 2, 2020
213a10e
addressing suggestions
tahmidefaz Jul 2, 2020
270d3fe
Remove redundant logging
Glutexo Jul 3, 2020
9628b91
Remove config file variable from Makefile
Glutexo Jul 3, 2020
8ad446c
update README
jharting Jul 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
freaking lint 🤦‍♂️
  • Loading branch information
tahmidefaz committed Jul 2, 2020
commit 6a0bd5baae2d1f911a7816f585ef9a6c914ff3ef
10 changes: 4 additions & 6 deletions app/logging.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging.config
import os
from logging import NullHandler
from threading import local

import logstash_formatter
@@ -30,8 +29,8 @@ def configure_logging(runtime_environment):
logging.config.dictConfig(logconfig_dict)
else:
print("Unable to configure watchtower logging. Please verify watchtower logging configuration!")
logconfig_dict['loggers']['inventory']['handlers'].remove('cloudwatch')
logconfig_dict['handlers'].pop('cloudwatch', None)
logconfig_dict["loggers"]["inventory"]["handlers"].remove("cloudwatch")
tahmidefaz marked this conversation as resolved.
Show resolved Hide resolved
logconfig_dict["handlers"].pop("cloudwatch", None)
logging.config.dictConfig(logconfig_dict)

logger = logging.getLogger(LOGGER_NAME)
@@ -47,9 +46,7 @@ def cloudwatch_handler():
logger.info(f"Configuring watchtower logging (log_group={aws_log_group}, stream_name={aws_log_stream})")
print(f"Configuring watchtower logging (log_group={aws_log_group}, stream_name={aws_log_stream})")
boto3_session = Session(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION_NAME,
aws_access_key_id=AWS_ACCESS_KEY_ID, aws_secret_access_key=AWS_SECRET_ACCESS_KEY, region_name=AWS_REGION_NAME
)
return watchtower.CloudWatchLogHandler(
boto3_session=boto3_session,
@@ -58,6 +55,7 @@ def cloudwatch_handler():
create_log_group=create_log_group,
)

tahmidefaz marked this conversation as resolved.
Show resolved Hide resolved

def _get_hostname():
return os.uname().nodename
tahmidefaz marked this conversation as resolved.
Show resolved Hide resolved