Skip to content

Commit

Permalink
reuse old logger and give it a name
Browse files Browse the repository at this point in the history
Signed-off-by: dentiny <[email protected]>
  • Loading branch information
dentiny committed Jan 3, 2025
1 parent 2160e0f commit 3129f18
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 1 addition & 3 deletions python/ray/_private/log_rotation_with_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def open_pipe_with_rotation(
lock = threading.Lock()
cond = threading.Condition(lock)

logger = logging.getLogger()
logger = logging.getLogger(name=fname)
logger.setLevel(logging.INFO)
handler = RotatingFileHandler(
fname, maxBytes=rotation_max_size, backupCount=rotation_file_num
Expand Down Expand Up @@ -88,8 +88,6 @@ def read_log_content_from_pipe():
# Two threads are used here to make sure continuous read from pipe thus avoid
# blocking write from application.
def dump_log_content_to_buffer():
logger = logging.getLogger()

while True:
with cond:
while not log_content and not stopped:
Expand Down
2 changes: 0 additions & 2 deletions python/ray/tests/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,6 @@ def component_file_only_one_log_entry(component):
f"backup count {backup_count}, file count: {file_cnt}"
)

# TODO(hjiang): Enable after log rotation implemented for user application.
#
# Test application log, which starts with `worker-`.
# Should be tested separately with other components since "worker" is a substring
# of "python-core-worker".
Expand Down

0 comments on commit 3129f18

Please sign in to comment.