Skip to content

Commit

Permalink
remove cloudwatch logger
Browse files Browse the repository at this point in the history
  • Loading branch information
colinbowen committed Nov 28, 2024
1 parent 667f6de commit e95284c
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions app/logger_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,6 @@ def format(self, record):
return super().format(record)


class CloudWatchHandler(logging.Handler):
def __init__(self, log_group, stream_name):
super().__init__()
self.client = boto3.client("logs")
self.log_group = log_group
self.stream_name = stream_name

def emit(self, record):
try:
log_entry = self.format(record)
self.client.put_log_events(
logGroupName=self.log_group,
logStreamName=self.stream_name,
logEvents=[
{
"timestamp": int(record.created * 1000),
"message": log_entry,
}
],
)
except ClientError as e:
print(f"Error sending log to CloudWatch: {e}")


def setup_logger(name, level, formatter):
"""Helper function to set up a logger."""
logger = logging.getLogger(name)
Expand Down

0 comments on commit e95284c

Please sign in to comment.