Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify log config to write errors to a separate log file #3050

Merged
merged 6 commits into from
Oct 31, 2024

Conversation

nvkevlu
Copy link
Collaborator

@nvkevlu nvkevlu commented Oct 25, 2024

Modify log config to write errors to a separate log file in addition to log.txt.

Description

Modify log config to write errors to a separate log file in addition to log.txt. I think this covers all the places we provide a default log config and this will enable future work for the error logs to be aggregated for reporting and downloading.

Updated nvflare/private/fed/utils/fed_utils.py to add an error log file to write errors to using the configuration of the error file handler based on the errorFileHandler in log.config.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Quick tests passed locally by running ./runtest.sh.
  • In-line docstrings updated.
  • Documentation updated.

@yanchengnv
Copy link
Collaborator

@IsaacYangSLA please review. Thanks!

@nvkevlu nvkevlu marked this pull request as draft October 28, 2024 21:24
@nvkevlu nvkevlu requested a review from SYangster October 28, 2024 21:26
@nvkevlu nvkevlu marked this pull request as ready for review October 30, 2024 15:58
@nvkevlu nvkevlu marked this pull request as draft October 30, 2024 16:25
@nvkevlu nvkevlu marked this pull request as ready for review October 30, 2024 18:13
yanchengnv
yanchengnv previously approved these changes Oct 30, 2024
Copy link
Collaborator

@yanchengnv yanchengnv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@nvkevlu
Copy link
Collaborator Author

nvkevlu commented Oct 30, 2024

/build

@nvkevlu nvkevlu enabled auto-merge (squash) October 30, 2024 19:54
Copy link
Collaborator

@YuanTingHsieh YuanTingHsieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM, have some questions

docs/resources/log.config Show resolved Hide resolved
class=FileHandler
level=ERROR
formatter=fullFormatter
args=('error.log', 'a')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we using this arg?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently not

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.

I would suggest either removing it in this PR or submit a follow up PR that makes use of this arg.

Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I tried removing it and there are errors, so it seems that it does go through some code that checks that there is at least one required positional argument so we may need to keep this for now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may be able to use it as template: use the configured file name instead of hard-coding it to error.log in fed_utils. But this may create other complications later when you try to send this log file to the server - you won't know the file name any more unless you keep it somewhere (e.g. data bus).

Let's deal with this in another PR.

@YuanTingHsieh
Copy link
Collaborator

/build

Copy link
Collaborator

@yanchengnv yanchengnv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nvkevlu nvkevlu merged commit d91b111 into NVIDIA:main Oct 31, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants