diff --git a/action_map.yml b/action_map.yml index b3189d61..25b14784 100644 --- a/action_map.yml +++ b/action_map.yml @@ -349,6 +349,9 @@ app: -s: full: --status help: Custom status command + -l: + full: --log + help: Absolute path to log file to display -r: full: --remove help: Remove service diff --git a/yunohost_app.py b/yunohost_app.py index 58d4ab43..3ae30bc3 100644 --- a/yunohost_app.py +++ b/yunohost_app.py @@ -581,13 +581,14 @@ def app_setting(app, key, value=None, delete=False): yaml.safe_dump(app_settings, f, default_flow_style=False) -def app_service(service, status=None, remove=False): +def app_service(service, status=None, log=None, remove=False): """ Add or remove a YunoHost monitored service Keyword argument: service -- Service to add/remove status -- Custom status command + log -- Absolute path to log file to display remove -- Remove service """ @@ -608,6 +609,9 @@ def app_service(service, status=None, remove=False): else: services[service] = { 'status': status } + if log is not None: + services[service]['log'] = log + with open(service_file, 'w') as f: yaml.safe_dump(services, f, default_flow_style=False)