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 56d476210894e15e20c67c99525e55edb9d5e5f3..61630d7769206921fa29c0bc731c948f92fe8f91 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):