NotionCommotion Posted June 1, 2017 Share Posted June 1, 2017 For general troubleshooting, do you recommend using syslog, Monolog, or something else? If Monolog or some other library, would you have it available globally, or inject it into each class? Thanks Quote Link to comment Share on other sites More sharing options...
ginerjm Posted June 1, 2017 Share Posted June 1, 2017 For general troubleshooting why wouldn't you just use the php error log? Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted June 1, 2017 Author Share Posted June 1, 2017 For general troubleshooting why wouldn't you just use the php error log? Not for errors but for general troubleshooting. I won't to log values, etc to determine how the script is running. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted June 1, 2017 Share Posted June 1, 2017 You are always asking the most bizarre and unrelated questions. I should have skipped this one too! Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted June 1, 2017 Author Share Posted June 1, 2017 You are always asking the most bizarre and unrelated questions. I should have skipped this one too! I would say this is one of my least bizarre and most boring question. Are you telling me that you never log anything other than errors? ... syslog(LOG_INFO,'got to this point'); ... syslog(LOG_INFO,'array foo: '.json_encode($foo)); ... Quote Link to comment Share on other sites More sharing options...
ginerjm Posted June 1, 2017 Share Posted June 1, 2017 No not at all. When I first had the need I wrote a little include module that has a couple of functions in it open/close a file and to write and display the contents. I did not go searching on the forums for a menial task such as this one. You on the other hand see it as something that requires expertise. Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted June 1, 2017 Author Share Posted June 1, 2017 No not at all. When I first had the need I wrote a little include module that has a couple of functions in it open/close a file and to write and display the contents. I did not go searching on the forums for a menial task such as this one. You on the other hand see it as something that requires expertise. Maybe you should Quote Link to comment Share on other sites More sharing options...
ginerjm Posted June 1, 2017 Share Posted June 1, 2017 Don't know why you think that.... I get along with my coding just fine. I don't overthink it I don't overwrite it. And I do research when something is beyond my knowledge. Have fun. Signing off this topic. Quote Link to comment Share on other sites More sharing options...
kicken Posted June 1, 2017 Share Posted June 1, 2017 If you want to actually integrate logging into your app as a feature, I'd go with something like Monolog. If you're just trying to add some temporary logging for help debugging, use something like syslog, error_log, or some simple file logging function for simplicity. If you're going to use Monolog or similar and you are already using depencency injection then you may as well inject it like any other service. Otherwise I'd probably use a factory class to obtain an instance of the logger. Monolog comes with a Registry class that could help with this. Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted June 1, 2017 Author Share Posted June 1, 2017 Thanks kicken, Both integrate into the app as well as just temporary logging. I typically use syslog for temporary logging, but found myself looking at both monologs and my system log, and became difficult to keep track. I'll stick with dependency injection. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.