diff --git a/nvflare/private/fed/app/client/worker_process.py b/nvflare/private/fed/app/client/worker_process.py index b0681d20af..7e16a372bc 100644 --- a/nvflare/private/fed/app/client/worker_process.py +++ b/nvflare/private/fed/app/client/worker_process.py @@ -14,11 +14,10 @@ """Provides a command line interface for a federated client trainer""" -import traceback - import argparse import os import sys +import traceback from nvflare.apis.fl_constant import FLContextKey from nvflare.apis.workspace import Workspace @@ -57,7 +56,6 @@ def main(): args.client_config = os.path.join(config_folder, "config_fed_client.json") args.config_folder = config_folder args.env = os.path.join("config", "environment.json") - args.log_config = None try: remove_restart_file(args) @@ -90,12 +88,19 @@ def main(): ) ) - workspace = os.path.join("/tmp/fl", client_name) # TODO: find a way to replace "/tmp/fl" + workspace = os.path.join("/tmp/fl", client_name) + app_root = os.path.join(args.workspace, "run_" + str(run_number), "app_" + client_name) + + app_log_config = os.path.join(app_root, config_folder, "log.config") + if os.path.exists(app_log_config): + args.log_config = app_log_config + else: + args.log_config = os.path.join(workspace, "log.config") conf = FLClientStarterConfiger( app_root=workspace, client_config_file_name=args.fed_client, - log_config_file_name=os.path.join(workspace, "log.config"), + log_config_file_name=args.log_config, kv_list=args.set, ) conf.configure() @@ -110,8 +115,6 @@ def main(): federated_client.fl_ctx.set_prop(EngineConstant.FL_TOKEN, token, private=False) federated_client.fl_ctx.set_prop(FLContextKey.WORKSPACE_ROOT, args.workspace, private=True) - app_root = os.path.join(args.workspace, "run_" + str(run_number), "app_" + client_name) - client_config_file_name = os.path.join(app_root, args.client_config) conf = ClientJsonConfigurator( config_file_name=client_config_file_name,