-
Notifications
You must be signed in to change notification settings - Fork 15
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
A specific log file #51
Conversation
Hello @WaPoNe Thanks for the PR, I hope you don't mind me asking. I'm not fully sure of the benefit here, when the magento 2 application tried to move to "log levels" with specific logs for debug/system/critical to cut down on the old magento1 case of there being 20 log files written to every day. To me that ISO level system makes much more sense. It doesn't really make much difference (in my mind) either way you're monitoring and reviewing your logs
Using a different file to separate logs, seems like it's trying to solve a problem that should be handled elsewhere, to better effect? |
Hello @convenient, If the module writes logs, I simply have to check the specific log file instead of having to read and filter through more generic files like system.log or exception.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay thanks. if this is something you need its probably something other people need so this is grand. I'm happy to proceed with this.
Can you please have a look at it though, i'm 99% certain that we don't need to define the CustomLogger
class and this is (all?) possible via di.xml
Logger/CustomLogger.php
Outdated
|
||
use Magento\Framework\Logger\Monolog; | ||
|
||
class CustomLogger extends Monolog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe its possible to inject the logger as a virtual type? So that we don't have the extra class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EDIT: Never mind, i spotted the issue here c1c6c66 the log handler level needed changed Hello @WaPoNe I have pulled this in and captured it in a test in #55 Most of this is looking great 👌 I can see the logs being written to the custom file just fine. I have one test at the end which is being flagged as off though It seems that the log is being written to the custom file, as well as the system.log. I am just checking if that is the intended situation here?
|
A specific log file.