error-logging

Does PHP error_reporting(0) affect error logging, or just display?

你离开我真会死。 提交于 2019-11-30 12:45:46
Does error_reporting(0); have any effect on error logging (to file), or does it just suppress on-screen error display? Thanks. Yes, it affects both. The error_reporting level defines what levels of errors gets triggered . Whether you log or display those errors are determined by the other settings. To summarize: error_reporting : What levels of errors get triggered. display_errors : Whether to show triggered errors in script output. log_errors : Whether to write triggered errors to a log. In essence, setting error_reporting(0) means that you've turned off error reporting, and nothing will be

Should I log messages to stderr or stdout?

我与影子孤独终老i 提交于 2019-11-30 12:23:46
问题 I have a program I'm writing that I want to write a custom logging facility for (e.g. diagnostic, notice, warning, error). Should I be using the stdout or the stderr stream to do this? It is an interpreter of sorts and the user can ask it to print output. Edit: Please stop recommending me logging frameworks :( 回答1: Regular output (the actual result of running the program) should go on stdout , things like you mentioned (e.g. diagnostic, notice, warning, error) on stderr . If there is no

Logging libraries for Erlang/OTP [closed]

末鹿安然 提交于 2019-11-30 08:27:52
For logging activity of an Erlang/OTP application, do you simply use a wrapper over disk_log or some other libraries? I've also found: http://github.com/sinnus/ejabberd_logger http://github.com/etnt/elogger http://github.com/JacobVorreuter/log_roller There is standard error logging application SASL http://www.erlang.org/doc/system_principles/error_logging.html . It can be configured to save logs on disk. error_logger:info_report example usage: 2> error_logger:info_report([{tag1,data1},a_term,{tag2,data}]). =INFO REPORT==== 11-Aug-2005::13:55:09 === tag1: data1 a_term tag2: data ok 3> error

Detecting console.log() calls

爱⌒轻易说出口 提交于 2019-11-30 07:25:34
I'm trying to write a test case for a debugging method that writes messages to the JavaScript console using console.log() . The test has to check that the message has been successfully written to the console. I'm using jQuery. Is there a way to attach a hook to console.log() or otherwise check that a message has been written to the console, or any other suggestions on how to write the test case? console.log doesn't keep a record of messages that are logged, or emit any events that you could listen for. It's not possible for your tests to directly verify its output from JavaScript. Instead,

Best Practices for Error Logging and/or reporting for iPhone

烂漫一生 提交于 2019-11-30 06:11:59
问题 When I do web development, I use a custom made logger that catches fatal errors and appends a trace to a file and displays a message to the user. I can occasionally glance to see if the file changed, which means, some user encountered an error and I can dig in to see what they encountered. I'd like something similar on the iphone, with some caveats: While developing, it should be trivial to reset the list of errors or turn off notification. While developing, the error messages should also

Should I log messages to stderr or stdout?

放肆的年华 提交于 2019-11-30 04:11:37
I have a program I'm writing that I want to write a custom logging facility for (e.g. diagnostic, notice, warning, error). Should I be using the stdout or the stderr stream to do this? It is an interpreter of sorts and the user can ask it to print output. Edit: Please stop recommending me logging frameworks :( Regular output (the actual result of running the program) should go on stdout , things like you mentioned (e.g. diagnostic, notice, warning, error) on stderr . If there is no "regular output", I would say that it doesn't really matter which one you choose. You could argue that the

How to log error message in drupal

徘徊边缘 提交于 2019-11-30 03:14:13
How to log our own error messages (for ex: error due to invalid user date entry) which is generated in php program to drupal error log . You can use the watchdog function : watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL) Quoting the manual, the parameters are : $type The category to which this message belongs. $message The message to store in the log. $variables Array of variables to replace in the message on display or NULL if message is already translated or not possible to translate. $severity The severity of the message, as per RFC 3164 $link A

PHP Error Logs in Heroku

微笑、不失礼 提交于 2019-11-29 16:36:54
问题 I have a PHP app deployed on Heroku, but I can't seem to locate the apache error log. Using the command $heroku logs I seem to get only the apache access logs. So a bunch of GET 200 OK etc, but no error information that is put into the error log locally, such as 'PHP Fatal error: blah blah ' Where do I access these error logs on Heroku, or how do I tell the app to write to Heroku's log like it does the local error log? I feel like I'm overlooking something obvious but I can't seem to find a

PHP log will not ignore repeated errors with ignore_repeated_errors = On

依然范特西╮ 提交于 2019-11-29 10:56:04
Although I have instructed php to only log an error once - i see the error over and over again in my log file. Any ideas why this directive would get ignored? I've restarted apache, etc. This directive will only stop the error from being logged again within the same script run . When the same script is run multiple times, you will still see that error every time. Besides the ignore_repeated_errors , there is also the ignore_repeated_source ini settings. I think that one would work for you and should stop showing the same error repeatedly, when same file is called over and over. As PHP manual

Adding properties to log message in NLog in .net core

混江龙づ霸主 提交于 2019-11-29 10:45:49
I am using NLog for logging messages in .net core. I have added NLog in StartUp.cs as follows: loggerFactory.AddNLog(); For logging to file, I am using following method: logger.LogInformation("Message"); I want to add custom NLog event properties to my message. But LogInformation() is not allowing me to pass that. How can I do that? truemedia If you want custom layout properties (NLog calls them layout renderers) you can use the EventProperties Layout Renderer . You can simply do this in your code: var logger = LogManager.GetCurrentClassLogger(); var eventInfo = new LogEventInfo(LogLevel.Info,