Skip to content

Commit

Permalink
Update Logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Dhamale authored and Jay Dhamale committed Dec 13, 2022
1 parent b0cc42d commit a39e0d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drf_api_logger/insert_log_into_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self):
if hasattr(settings, 'DRF_API_LOGGER_DEFAULT_DATABASE'):
self.DRF_API_LOGGER_DEFAULT_DATABASE = settings.DRF_API_LOGGER_DEFAULT_DATABASE

self.DRF_LOGGER_QUEUE_MAX_SIZE = 50 # Default queue size 50
self.DRF_LOGGER_QUEUE_MAX_SIZE = 4 # Default queue size 50
if hasattr(settings, 'DRF_LOGGER_QUEUE_MAX_SIZE'):
self.DRF_LOGGER_QUEUE_MAX_SIZE = settings.DRF_LOGGER_QUEUE_MAX_SIZE

Expand Down Expand Up @@ -64,6 +64,7 @@ def _insert_into_data_base(self, bulk_item):
with open('text', 'a') as f:
for element in bulk_item:
f.write(element)
f.close()

# APILogsModel.objects.using(self.DRF_API_LOGGER_DEFAULT_DATABASE).bulk_create(bulk_item)
except OperationalError:
Expand Down

0 comments on commit a39e0d0

Please sign in to comment.