diff --git a/test_data/turbinia_logs.log b/test_data/turbinia_logs.log index 8acb48b74..56e08da24 100644 --- a/test_data/turbinia_logs.log +++ b/test_data/turbinia_logs.log @@ -1,20 +1,10 @@ 2024-08-08 16:52:48,110 [INFO] uvicorn.error | Application startup complete. -2024-08-08 16:52:48,110 [INFO] uvicorn.error | Application startup complete. -2024-08-08 16:52:48,124 [INFO] uvicorn.error | Started server process [1232189] 2024-08-08 16:52:48,124 [INFO] uvicorn.error | Started server process [1232189] 2024-08-08 16:52:48,124 [INFO] uvicorn.error | Waiting for application startup. -2024-08-08 16:52:48,124 [INFO] uvicorn.error | Waiting for application startup. 2024-08-08 16:52:48,124 [INFO] uvicorn.error | Application startup complete. -2024-08-08 16:52:48,124 [INFO] uvicorn.error | Application startup complete. -2024-08-08 16:52:48,136 [INFO] uvicorn.error | Started server process [1232191] 2024-08-08 16:52:48,136 [INFO] uvicorn.error | Started server process [1232191] 2024-08-08 16:52:48,137 [INFO] uvicorn.error | Waiting for application startup. -2024-08-08 16:52:48,137 [INFO] uvicorn.error | Waiting for application startup. -2024-08-08 16:52:48,137 [INFO] uvicorn.error | Application startup complete. 2024-08-08 16:52:48,137 [INFO] uvicorn.error | Application startup complete. 2024-08-08 16:52:50,468 [INFO] uvicorn.access | 127.0.0.1:39730 - "GET /api/logs/api_server/100 HTTP/1.1" 200 -2024-08-08 16:52:50,468 [INFO] uvicorn.access | 127.0.0.1:39730 - "GET /api/logs/api_server/100 HTTP/1.1" 200 -2024-08-08 16:53:26,287 [INFO] uvicorn.access | 127.0.0.1:53206 - "GET /api/logs/logs/ed6c72f82d42/100 HTTP/1.1" 200 2024-08-08 16:53:26,287 [INFO] uvicorn.access | 127.0.0.1:53206 - "GET /api/logs/logs/ed6c72f82d42/100 HTTP/1.1" 200 -2024-08-08 16:53:51,856 [INFO] uvicorn.access | 127.0.0.1:33544 - "GET /openapi.yaml HTTP/1.1" 200 2024-08-08 16:53:51,856 [INFO] uvicorn.access | 127.0.0.1:33544 - "GET /openapi.yaml HTTP/1.1" 200 \ No newline at end of file diff --git a/turbinia/api/api_server_test.py b/turbinia/api/api_server_test.py index c897a2de5..d2731d1c1 100644 --- a/turbinia/api/api_server_test.py +++ b/turbinia/api/api_server_test.py @@ -672,10 +672,10 @@ def testGetTurbiniaLogs(self): turbinia_config.LOG_DIR = test_data_dir with open(f'{test_data_dir}/turbinia_logs.log', 'rb') as f: expected = f.read() - response = self.client.get(f'/api/logs/{hostname}/20') - self.assertEqual(response.content, expected) response = self.client.get(f'/api/logs/{hostname}/10') + self.assertEqual(response.content, expected) + response = self.client.get(f'/api/logs/{hostname}/5') self.assertNotEqual(response.content, expected) hostname = 'invalid_hostname' - response = self.client.get(f'/api/logs/{hostname}/20') + response = self.client.get(f'/api/logs/{hostname}/10') self.assertEqual(response.status_code, 404) diff --git a/turbinia/config/logger.py b/turbinia/config/logger.py index e4a5bc14f..54a6a3188 100644 --- a/turbinia/config/logger.py +++ b/turbinia/config/logger.py @@ -97,8 +97,6 @@ def setup(need_file_handler=True, need_stream_handler=True, log_file_path=None): for handler in root_log.handlers: root_log.removeHandler(handler) root_log.addHandler(console_handler) - if need_file_handler: - root_log.addHandler(file_handler) # Set up uvicorn loggers uvicron_error = logging.getLogger('uvicorn.error')