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
943 views Asked by AudioBubble At
2
There are 2 answers
Related Questions in PHP
- How to add the dynamic new rows from my registration form in my database?
- Issue in payment form gateway
- How to create a facet for WP gridbuilder that displays both parent and child custom fields?
- Function in anonymous Laravel Blade component
- How to change woocomerce or full wordpress currency with value from USD to AUD
- General questions about creating a custom theme Moodle CMS
- How to add logging to an abstract class in php
- error 500 on IIS FastCGI but no clue despite multiple error loggings activated
- Composer installation fails and reverts ./composer.json and ./composer.lock to original content
- How to isolate PHP apps from each other on a local machine(Windows or Linux)?
- Laravel: Using belongsToMany relationship with MongoDB
- window.location.href redirects but is causing problems on the webpage
- Key provided is shorter than 256 bits, only 64 bits provided
- Laravel's whereBetween method not working with two timestamps
- Implementing UUID as primary key in Laravel intermediate table
Related Questions in APACHE
- Special access rule in an .htaccess file for IP addresses, authorized only for one directory structure
- How to isolate PHP apps from each other on a local machine(Windows or Linux)?
- Cannot load modules/mod_dav_svn.so into server
- How to ignore case in regexp mapping in a .htaccess rewrite rule?
- Oracle Http server ISNT-07551
- I cant access file directory with PHP local host on XAMPP. it just shows one of the files I have in my visual studio code
- Apache Reverse Proxy: only one proxy directive is working. Second one is ignored
- Issue with Django --> Apache WSGI deployment
- changing the node version used by apache web server
- Apache: How can I redirect to a subfolder with a URL param but serve required content via the main URL?
- Why/How does Apache auto-include "DHE" TLS1.2 ciphers while nginx needs "dhparams" file?
- Set up MX records in apache/Ubuntu to point to external mail server
- How to proxy to another port?
- Php can not upload file out of /var/www/html even after disabling Selinux
- Serve static site on S3 + CloudFlare with Apache retaining the source URL
Related Questions in LOGGING
- ModuleNotFoundError: No module named 'src' while importing logging
- How to get domains in Shadowsocks server log with Shadowsocks Android
- How to enable log to console Cosmos Client SDK requests
- pino-pretty logging special characters as literal
- unable to serialize JSON type logs In fluentd(logging-operator)
- How to configure different loggers separately in structlog?
- detect catalina.out log path from a running tomcat on non-Windows
- apache2 rotatelogs creates log file but its empty when deployed to azure web app
- Ubuntu:24.04 Container generating excessive logs
- Transform Load pipeline for a logs system: Apache Airflow or Kafka Connect?
- Deisred log is not rotating
- Purpose of setting debug="false" in log4j at configuration level
- RobotFramework hangs after xx lines of log
- logging in multiprocess writes to same log
- Masking in logback.xml with all request and responses
Related Questions in ECHO
- How to reduce noise in recordings with a known audio file
- "echo -e" does not display trailing \n?
- Trying to echo line variable along with another variable inside a while read loop
- How to preserve newline characters in CSH when storing in a variable or echo
- Weirdness with output in Git Bash in Windows
- MSTeams echo bot using PowerShell Azure Functions
- Echo -e on MacOS
- Difference between tcsh and bsd-csh in terms of use of square brackets in echo
- Divide two signal stream using GNU Radio but no result appear
- JSON String processing injects quotes
- Can you have 2 queries on different tables to create check boxes and have them "checked"?
- Can a csh script be made to "Not Execute" the date command in an echo statement
- How to install templ in macos. Error:- templ not found
- Exposing API endpoints in Wails with Axios (404)
- zsh prompt in read/echo for variable input
Related Questions in DIE
- atexit(3) in Perl: `END {}` or `$SIG{__DIE__}`?
- How set dd(dump and die) in yii2 framework?
- PHP $_SESSION- comparison between scripts
- die() or exit() without destructors?
- NetLogo hatch and die
- why the die() don't catch the fatal error?
- die() is not stopping code from executing
- breaks while loop when all die rolls the same number
- Strange PHP DIE() behaviour
- When does php prepare to send headers?
- Dice combinations to a total
- where is perl eval "...propagated" documented
- PHP - logic - if else / or die?
- How can I write a SIG{__DIE__} handler that does not trigger in eval blocks?
- How do you catch a buggy sig die handler if the mechanism to debug code that everyone uses overrides it?
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?
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)
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).