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

Logging to file for action server #306

Merged
merged 15 commits into from
Jan 11, 2021

Conversation

dingusagar
Copy link
Contributor

@dingusagar dingusagar commented Oct 15, 2020

Proposed changes:

  • Added command line argument option for the action server to save logs to a log file.

Status (please check what you already did):

  • made PR ready for code review
  • added some tests for the functionality
  • updated the documentation
  • updated the changelog (please check changelog for instructions)
  • reformat files using black (please check Readme for instructions)

@CLAassistant
Copy link

CLAassistant commented Oct 15, 2020

CLA assistant check
All committers have signed the CLA.

@dingusagar dingusagar changed the title Logging file for action Logging to file for action server Oct 15, 2020
@dingusagar
Copy link
Contributor Author

Linked issue here #161

@roniemartinez
Copy link

Awesome! Hope the project owners review this. 💯

@sara-tagger
Copy link

Thanks for submitting a pull request 🚀 @melindaloubser1 will take a look at it as soon as possible ✨

@iwt-kschoenrock
Copy link

Wouldn't it be better to use a RotatingFileHandler directly? This would allow you to set backupCount to avoid eventually running out of space because of old logs.
Maybe let the user configure the number of backup files kept around?

@dingusagar
Copy link
Contributor Author

dingusagar commented Oct 17, 2020

Wouldn't it be better to use a RotatingFileHandler directly? This would allow you to set backupCount to avoid eventually running out of space because of old logs.
Maybe let the user configure the number of backup files kept around?

RotatingFileHandler seems to be a better choice than FileHandler. backupCount argument can be kept to 0 by default so that the default behaviour is a single file growing indefinitely. And user can specify backupCount as a command line argument.

What do you think should be the value of maxBytes argument. Do you feel that needs to be configurable as well? @iwt-kschoenrock / @roniemartinez
Shall I add this enhancement to the PR. Any concerns / thoughts? @melindaloubser1

@iwt-kschoenrock
Copy link

RotatingFileHandler seems to be a better choice than FileHandler. backupCount argument can be kept to 0 by default so that the default behaviour is a single file growing indefinitely. And user can specify backupCount as a command line argument.

What do you think should be the value of maxBytes argument. Do you feel that needs to be configurable as well? @iwt-kschoenrock / @roniemartinez
Shall I add this enhancement to the PR. Any concerns / thoughts? @melindaloubser1

I don't have any current examples of how big the Rasa Logs would be, maybe someone from Rasa could give an estimate? But I agree that backuptCount and maxBytes should be configurable.

This functionality is important for us, as we're looking for ways to configure ingestion of multi-line logs in Datadog, and the log file would probably be the easiest way to achieve it, apart from the nonplusultra solution, which would be allowing a custom log formatter or log configuration file to be provided.

@indam23 indam23 self-requested a review October 19, 2020 09:54
@indam23
Copy link
Contributor

indam23 commented Oct 19, 2020

The action server runs separately from the rasa server, so logging to files for custom actions should be configured on the action server itself (whether rasa-sdk or another action server). The changes look like they're configuring logging of all logs to a file (for the rasa server). Can you clarify the desired behaviour of the change?

@dingusagar
Copy link
Contributor Author

dingusagar commented Oct 19, 2020

The action server runs separately from the rasa server, so logging to files for custom actions should be configured on the action server itself (whether rasa-sdk or another action server). The changes look like they're configuring logging of all logs to a file (for the rasa server). Can you clarify the desired behaviour of the change?

valid point. I have updated the code to configure logging only for action server. I gave "rasa_sdk" as the name for the named logger. so now the configuration is only for loggers within the module rasa_sdk.

Could you review my latest changes? @melindaloubser1
Thanks

Copy link
Contributor

@indam23 indam23 left a comment

Choose a reason for hiding this comment

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

The logging to file works great, but it seems to set the logging level to debug regardless of what is passed as the log level - could you look into that?

@dingusagar
Copy link
Contributor Author

The logging to file works great, but it seems to set the logging level to debug regardless of what is passed as the log level - could you look into that?

Ok I will look into it

@dingusagar
Copy link
Contributor Author

dingusagar commented Nov 14, 2020

The logging to file works great, but it seems to set the logging level to debug regardless of what is passed as the log level - could you look into that?

Hi @melindaloubser1
I have pushed the fix for setting the log level of root logger of the project from the command line args. Could you review it.

I noticed that the logger for matplotlib is set to WARN and logger for loglevel for sanic logger is set by environment variables. I have't changed any of those. But let me know if these loglevels also needs to controlled by the arguement passed in the command line args

@wochinge
Copy link
Contributor

fixing the code_quality step here. Sorry for the inconvenience!

@dingusagar dingusagar requested a review from indam23 January 3, 2021 05:12
Copy link
Contributor

@indam23 indam23 left a comment

Choose a reason for hiding this comment

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

Can you run make formatter and apply the changes? The linting step is failing.

@dingusagar
Copy link
Contributor Author

Can you run make formatter and apply the changes? The linting step is failing.

sure @melindaloubser1
have made the changes for the errors given by make lint

@dingusagar dingusagar requested a review from indam23 January 6, 2021 17:46
@indam23
Copy link
Contributor

indam23 commented Jan 6, 2021

Sorry one more thing, can you add a changelog entry please? You'll find instructions for that in the changelog/README.md

@dingusagar
Copy link
Contributor Author

Sorry one more thing, can you add a changelog entry please? You'll find instructions for that in the changelog/README.md

added a changelog entry.

@dingusagar dingusagar requested a review from indam23 January 7, 2021 04:16
@indam23 indam23 merged commit 2e922f5 into RasaHQ:master Jan 11, 2021
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.

7 participants