From a8f77a05ded51a16f4fdd15529d4fc81de6a6dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Wed, 13 Nov 2024 18:59:53 +0100 Subject: [PATCH] Removed exception log and added base for allow client logs upload --- server/src/uds/REST/methods/actor_v3.py | 2 +- server/src/uds/REST/methods/client.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/uds/REST/methods/actor_v3.py b/server/src/uds/REST/methods/actor_v3.py index fb85c44ed..e0f4fcbfc 100644 --- a/server/src/uds/REST/methods/actor_v3.py +++ b/server/src/uds/REST/methods/actor_v3.py @@ -811,7 +811,7 @@ class Unmanaged(ActorV3Action): dbservice = Service.objects.get(token=token) service: 'services.Service' = dbservice.get_instance() except Exception: - logger.exception('Unmanaged host request: %s', self._params) + logger.warning('Unmanaged host request: %s', self._params) return ActorV3Action.actor_result(error='Invalid token') # ensure idsLists has upper and lower versions for case sensitive databases diff --git a/server/src/uds/REST/methods/client.py b/server/src/uds/REST/methods/client.py index 748cd8223..672581c77 100644 --- a/server/src/uds/REST/methods/client.py +++ b/server/src/uds/REST/methods/client.py @@ -234,15 +234,16 @@ class Client(Handler): log: str = self._params.get('log', '') # Right now, log to logger, but will be stored with user logs + logger.info('Client %s: %s', self._request.user.pretty_name, userservice.service_pool.name) for line in log.split('\n'): # Firt word is level try: level, message = line.split(' ', 1) userservice.log(message, LogLevel.from_str(level), LogSource.CLIENT) + logger.info('Client %s: %s', self._request.user.pretty_name, message) except Exception: # If something goes wrong, log it as debug pass - # logger.info('Client log for %s: %s', self._request.user.pretty_name, line) case _: return Client.result(error='Invalid command')