1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Removed exception log and added base for allow client logs upload

This commit is contained in:
Adolfo Gómez García 2024-11-13 18:59:53 +01:00
parent beea237758
commit a8f77a05de
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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')