From 1ddcdad6284ff10e7670a8bc1e459bad2e725c18 Mon Sep 17 00:00:00 2001 From: sevi-kun Date: Tue, 3 Mar 2026 21:57:27 +0100 Subject: [PATCH] add check queue size --- main.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main.py b/main.py index 765ad9d..757b71b 100755 --- a/main.py +++ b/main.py @@ -231,6 +231,12 @@ class LogMonitor: # Add source file information log_data['source_file'] = source_file + # Log the full data being sent + logger.debug(f"Preparing to send log to LogBull:") + logger.debug(f" - Type: {log_data.get('type')}") + logger.debug(f" - Source: {source_file}") + logger.debug(f" - Full data: {log_data}") + # Send based on log type if log_data['type'] == 'access': logger.debug(f"Sending ACCESS log to LogBull: {log_data.get('method')} {log_data.get('path')} - {log_data.get('status')}") @@ -244,6 +250,11 @@ class LogMonitor: self.logbull_logger.error("NGINX Error Log", fields=log_data) logger.debug(f"LogBull message queued successfully (type={log_data['type']})") + + # Check queue size + if hasattr(self.logbull_logger, 'sender') and self.logbull_logger.sender: + queue_size = self.logbull_logger.sender._log_queue.qsize() + logger.debug(f"LogBull queue size: {queue_size}") except Exception as e: logger.error(f"Error sending to LogBull: {e}", exc_info=True)