Skip to content

Commit

Permalink
Add: Log event model when debug is enabled (#60)
Browse files Browse the repository at this point in the history
Add: Log event model when debug is enabled
Bump version to 1.8.2
  • Loading branch information
keyur9 committed Jul 6, 2023
1 parent c7796a9 commit 7e73ab9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion moesifwsgi/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from moesifapi.moesif_api_client import *
from moesifpythonrequest.app_config.app_config import AppConfig
from moesifpythonrequest.start_capture.start_capture import StartCapture

from moesifapi.api_helper import *
from .client_ip import ClientIp
from .event_mapper import EventMapper
from .http_response_catcher import HttpResponseCatcher
Expand Down Expand Up @@ -186,9 +186,13 @@ def process_and_add_event_if_required(self, event_info, environ, response_header
# Add Event to the queue if able and count the dropped event if at capacity
if self.worker_pool.add_event(event_data):
logger.debug("Add Event to the queue")
if self.DEBUG:
logger.debug("Event added to the queue - " + APIHelper.json_serialize(event_data))
else:
self.dropped_events += 1
logger.info("Dropped Event due to queue capacity drop_count=" + str(self.dropped_events))
if self.DEBUG:
logger.debug("Event dropped - " + APIHelper.json_serialize(event_data))
# add_event does not throw exceptions so this is unexepected
except Exception as ex:
logger.exception("Error while adding event to the queue for", ex)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='1.8.1',
version='1.8.2',

description='Moesif Middleware for Python WSGI based platforms (Flask, Bottle & Others)',
long_description=long_description,
Expand Down

0 comments on commit 7e73ab9

Please sign in to comment.