473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

logging all errors to a file

I'm trying to log all PHP errors to a file and am having some
difficulty. PHP is running via FastCGI / Apache and in the directory
in which my test script is running, my php.ini file is as follows:

error_reporting = E_ALL
error_log = "error_log"

Here's the PHP script I'm using:

<?php
unpack('Na/Nb', str_repeat(chr('0'), 7));
?>

When I point my browser to that, I get the following error:

Warning: unpack() [function.unpack]: Type N: not enough input, need 4,
have 3 in /path/to/test.php on line 2

The thing is... that error isn't being logged to ./error_log. Any
ideas as to why it isn't?
Aug 5 '08 #1
3 1389
On Aug 5, 9:20 pm, yawnmoth <terra1...@yahoo.comwrote:
I'm trying to log all PHP errors to a file and am having some
difficulty. PHP is running via FastCGI / Apache and in the directory
in which my test script is running, my php.ini file is as follows:

error_reporting = E_ALL
error_log = "error_log"

Here's the PHP script I'm using:

<?php
unpack('Na/Nb', str_repeat(chr('0'), 7));
?>

When I point my browser to that, I get the following error:

Warning: unpack() [function.unpack]: Type N: not enough input, need 4,
have 3 in /path/to/test.php on line 2

The thing is... that error isn't being logged to ./error_log. Any
ideas as to why it isn't?
No but you could try using absolute paths and checking permissions on
the log file. Also, check your webserver error log (where there may be
more information on why it not writing to "./error_log").

C.
Aug 6 '08 #2
yawnmoth wrote:
I'm trying to log all PHP errors to a file and am having some
difficulty. PHP is running via FastCGI / Apache and in the directory
in which my test script is running, my php.ini file is as follows:

error_reporting = E_ALL
error_log = "error_log"

Here's the PHP script I'm using:

<?php
unpack('Na/Nb', str_repeat(chr('0'), 7));
?>

When I point my browser to that, I get the following error:

Warning: unpack() [function.unpack]: Type N: not enough input, need 4,
have 3 in /path/to/test.php on line 2

The thing is... that error isn't being logged to ./error_log. Any
ideas as to why it isn't?
In php.ini what path does it give for errors? Or, if you put phpinfo()
in a file and then look at that through the browser, does it say whether
error logging is on or off, and does it give a path?
Aug 7 '08 #3
*** yawnmoth escribió/wrote (Tue, 5 Aug 2008 13:20:15 -0700 (PDT)):
I'm trying to log all PHP errors to a file and am having some
difficulty. PHP is running via FastCGI / Apache and in the directory
in which my test script is running, my php.ini file is as follows:

error_reporting = E_ALL
error_log = "error_log"
Sorry if it's obvious but you also need:

log_errors = On
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor en cubitos: http://www.demogracia.com
--
Aug 7 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Robert.Schmitt | last post by:
I found that the configuration system of the new logging package of Python 2.3 has some unintuitive idiosyncracies that are worth mentioning because they can cost you quite some development time...
2
by: Tor Erik Sønvisen | last post by:
Hi Have the following code: import logging logging.basicConfig(level = logging.DEBUG, format = ' %(message)s', filename = 'rfs.log', filemode = 'w')
8
by: A.M | last post by:
Hi, What would be the best approach to log different items (SQL, Exceptions, Security, ...) I have a simple Logging function that adds log string to the end of a text file. Is there any...
7
by: Leo Breebaart | last post by:
I have another question where I am not so much looking for a solution but rather hoping to get some feedback on *which* solutions people here consider good Pythonic ways to approach a issue. ...
7
by: flupke | last post by:
Hi, i'm getting errors with the log module concerning RotatingFileHandler. I'm using Python 2.4.3 on Windows XP SP2. This used to work in previous python versions but since i upgraded to 2.4.3...
3
by: nicholas.petrella | last post by:
I am currently trying to use the python logging system as a core enterprise level logging solution for our development and production environments. The rotating file handler seems to be what I...
3
by: evenrik | last post by:
An a redhat box I have root, apache and other normal users run code that uses the logging module to write to the same log file. Since umasks are set to 2 or 022 this gets permission errors. I...
17
by: Cramer | last post by:
I plan to implement an exception logging feature in an ASP.NET Web application that writes encountered exceptions to disk. The exception data will be stored as XML. I am planning on having each...
4
by: Alexandru Mosoi | last post by:
why doesn't logging throw any exception when it should? how do I configure logging to throw exceptions? .... logging.fatal('asdf %d', '123') .... except: .... print 'this line is never...
1
by: arunairs | last post by:
Hi, Using the EnterpriseLibrary 4.0, is it possible to Log the method name in the log file. I have it cofigured thus: <loggingConfiguration name="Logging Application Block"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.