diff --git a/python/paddle/distributed/fleet/elastic/manager.py b/python/paddle/distributed/fleet/elastic/manager.py index 4e8853780f4dcd4a5f35c6fcb022413d068ae243..2a344e92765d94e43079f7a4ed14aa51447ae179 100644 --- a/python/paddle/distributed/fleet/elastic/manager.py +++ b/python/paddle/distributed/fleet/elastic/manager.py @@ -20,8 +20,13 @@ import logging import signal import random -logging.basicConfig(level=os.environ.get('LOGLEVEL', 'INFO').upper()) logger = logging.getLogger("ELASTIC") +logger.setLevel(logging.INFO) +formatter = logging.Formatter( + fmt='%(name)s %(levelname)s %(asctime)s %(message)s') +ch = logging.StreamHandler() +ch.setFormatter(formatter) +logger.addHandler(ch) ELASTIC_EXIT_CODE = 101 diff --git a/python/paddle/fluid/incubate/fleet/parameter_server/pslib/optimizer_factory.py b/python/paddle/fluid/incubate/fleet/parameter_server/pslib/optimizer_factory.py index e2fb29c5439e111179e96a247443dbedaa2816c1..758c61fce1e5c007b7441c26ea6d3bc55bff37ed 100644 --- a/python/paddle/fluid/incubate/fleet/parameter_server/pslib/optimizer_factory.py +++ b/python/paddle/fluid/incubate/fleet/parameter_server/pslib/optimizer_factory.py @@ -42,9 +42,12 @@ FLEET_GLOBAL_DICT = { "scale_sparse_grad": None, } -logging.basicConfig( - format='%(asctime)s - %(levelname)s - %(message)s', level=logging.INFO) logger = logging.getLogger(__name__) +logger.setLevel(logging.INFO) +formatter = logging.Formatter(fmt='%(asctime)s - %(levelname)s - %(message)s') +ch = logging.StreamHandler() +ch.setFormatter(formatter) +logger.addHandler(ch) class DistributedOptimizerImplBase(object):