The questions says everything. I am logging something on STDOUT.Should I use echo for displaying or Die().As far as I know If I use die() for normal printing like die('Entered in For loop'), it exits the program.
Also is it good to log to files or mysql?
use echo or Die for debugging and logging
940 Views Asked by AudioBubble At
2
There are 2 best solutions below
Related Questions in PHP
- php Variable name must change in for loop
- register_shutdown_function is not getting called
- Query returning zero rows despite entries existing
- Retrieving *number* pages by page id
- Automatically closing tags in form input?
- How to resize images with PHP PARSE SDK
- how to send email from localhost using codeigniter?
- Mariadb max Error while sending QUERY packet PID
- Multiusers login redirect different page in php
- Imaginary folder when I use "DirectoryIterator" in PHP?
- CodeIgniter + XDebug: debug only working in the main controller, index() function
- PHP script timeout when I use sleep()
- posting javascript populated form to another php page
- AJAX PHP - Reload div after submit
- PHP : How can I check Array in array?
Related Questions in APACHE
- .htaccess redirect 403 error files to 404 error document
- RestApi server code is not workinng
- Convert Apache VirtualHost to nginx Server Block for Dynamic Subdomains
- Looking the Method that MANUALLY INSTALL PHP on OSX Yosemite
- Premature end of script on VPS
- Rasterization with Javascript looks different on Apache server
- Vagrant - Ansible error installing Apache
- Can't use subdomain in Chrome using Apache (XAMPP)
- Django webapp (on an Apache2 server) hangs indefintely when importing nltk in views.py
- Redirect keystone app to sub directory using htaccess
- How can I integrate Solr5.1.0 with Nutch1.10
- Disconnect Client connected to cgi application
- Solr ping taking time during full import
- How to redirect an incoming request to specific serverName to different server in apache2?
- What is the correct way to link Django Flatpages?
Related Questions in LOGGING
- Is Log4j2 xml configuration case sensitive?
- Logback stopped logging after splitting shared config file
- logging setup best practices
- C Simple Logging Management
- OpenShift Pyramid logging to file
- Log of dependency does not show
- Node/Express access logger from request object
- How does one locate all git log messages in the git object database?
- Logging error when executing Maven SonarQube plugin
- refactor 'execute and log' pattern
- CMD specifying columns to save?
- How to get information about error from HttpContext in WCF services
- Django not logging all errors
- Empty space at beginning of rsyslog log file
- Avoid log trace of external framework J2EE
Related Questions in ECHO
- Why do print and echo behave differently in a "for" loop
- PHP: Body is displaying 0
- loop for file location until file exists in bash
- Echo Selected base on $_GET value from a dynamic select box
- Create text file using echo in command prompt
- What is the difference between "echo" and "echo -n"?
- Echo of time not displayed at end of batch file
- Php code does not come out from MySQL Database properly
- Parsing/Open XML document in echo
- echoing webpage title from the defined list
- Configuring client throughput in simple TCP server
- Alternative for echo in sending header plugin
- print filenames into scripts in bash
- Bash output limited to echo only
- PHP: echo item from array by its value instead of by its array index
Related Questions in DIE
- Show a loading symbol whilst running a PHP script
- search result die and redirect
- NetLogo: n-of error when all turtles die
- Will code after eval(die "some error message") continue to be executed?
- Is there a need for die; after print json_encode() when responding to api calls?
- MySQLi update and die(); and exit(); not working
- How to use the same php function in ajax, and non ajax
- Perl built in exit and print in one command
- $.live() and $.die() binding and unbinding
- Why doesn't the die() function work?
- use echo or Die for debugging and logging
- best approach for debugging in PHP and mysql
- PHP - Unable to create file
- atexit(3) in Perl: `END {}` or `$SIG{__DIE__}`?
- register_shutdown_function() and die()
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
For debugging I prefer
var_dump(). If you install Xdebug (http://xdebug.org/) in your development environment, you'll get a lot more out of var_dump.When I want to kill a script I'm debugging, I wrap die around that, as in
die(var_dump()).For logging, look into PHP's
error_log()(http://www.php.net/manual/en/function.error-log.php) function or a logging library such as monolog (https://github.com/Seldaek/monolog).