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

Add logging in Console Controller #49

Merged
merged 1 commit into from
Jan 3, 2017

Conversation

kyle-mccarthy
Copy link
Contributor

Added the the ability to excluded certain items from being included in the log. For instance, the std output for "Running new process... No job" was causing massive log files. The user can exclude what actions they would like to omit from the log. Additionally, the user may now choose to log the output to the console, or they can choose to log it using Yii to the app.log runtime file.

@petrabarus
Copy link
Contributor

I'd prefer adding Yii::info after stdout and in the execution use > /dev/null and create your own logroute.

@kyle-mccarthy
Copy link
Contributor Author

I struggled with which was the best way to handle it, I've updated it so they can just output at execution rather than relying on the Yii config. Also, I have added more 'actions' so the user has more control over what can be excluded or included in the log. Let me know if you think there are any other things that should be changed.

@petrabarus
Copy link
Contributor

That is good, although I still prefer letting Yii logroute to handle instead of setting it ourselves in the class.

@kyle-mccarthy
Copy link
Contributor Author

Okay I will look into that, I don't know if I am familiar with what you are referencing or if I just refer to it differently. Could you point me in a direction of what you're talking about and I'll add the commit in the morning?

@petrabarus
Copy link
Contributor

This one http://www.yiiframework.com/doc-2.0/guide-runtime-logging.html#log-targets

My point is, let's just log all the output and let the user decide which category they want to log.

@kyle-mccarthy
Copy link
Contributor Author

Oh you're referring to the levels correct? My concern with this is the amount of logging that happens with "Running new process... No job", and that is the main reason that I created the PR. I personally think that it is unnecessary to continuously log this particular line, as it results in massive log files. I really only want to log information about what task was run and then any info that was outputted from that task.

@petrabarus
Copy link
Contributor

Ah I see. How about just keep the stdout and stderr and just simply add Yii::info and Yii::error in points that we need to log?

@kyle-mccarthy
Copy link
Contributor Author

I simplified the logging process and am deferring to the console config settings now.

@petrabarus
Copy link
Contributor

Thanks a lot!

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.

None yet

2 participants