473,387 Members | 1,394 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,387 software developers and data experts.

Is there a PHP logging and analysing utility ?

I switched to Windows server and logs generated by my ISP are pathetic
comparing to those from Apache. I would like to do logging via PHP and
use the same log for visits and for PHP tracing. That means there can
be plenty of information and lot of file/database access. Now there is
several problems to address:

1. For performance reasons, the log messages should be collected in
array and then flushed into the file with single I/O access rather than
I/O access with appending every single record.

2. Is there some way in PHP to synchronise file access from another
concurrent request ?

3. Because of #1, the time-stamps of record from concurrent requests
may not be sorted. This should be probably addressed during processing.

4. Processing and analysing of the captured logs, recognizing visitor
sessions, unique visitors, etc.

Points 1-3 could be disregarded if database was used for logging. But I
am afraid that database access will be always slower than direct file
access.

Before I dive into coding, I would like explore if there is something
already available and I will appreciate references to scripts with good
performance and analysing utility.

Thanks
Roman

Mar 30 '06 #1
1 1749

Roman Ziak wrote:
1. For performance reasons, the log messages should be collected in
array and then flushed into the file
This is very hard. After a request has been done, the PHP script is
done and its variables are no longer there. You would have to use
shared memory or something like that. A file is much easier.
2. Is there some way in PHP to synchronise file access from another
concurrent request ?


flock()

You probably want to write a Apache-like rule, so you can use standard
tools to process it. For performance, first put the rule in a string,
than lock the file, write the string, unlock the file. That should work
fast enough.

Mar 30 '06 #2

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

Similar topics

6
by: Eric DeWall | last post by:
In trying to clean up the inevitable debug printing littered through some code, I started reading up on the 'logging' module. Browsing groups indicates that the design of the module is...
0
by: Joe Bloggs | last post by:
Hi all, I take the pleasure to inform that Dotnet Commons Logging has been released for use. Dotnet Commons Logging, a subproject of the Donet Commons project currently located under the...
23
by: Rotem | last post by:
Hi, while working on something in my current project I have made several improvements to the logging package in Python, two of them are worth mentioning: 1. addition of a logging record field...
10
by: Thomas Heller | last post by:
I'm about to add some logging calls to a library I have. How can I prevent that the script that uses the library prints 'No handlers could be found for logger "comtypes.client"' when the script...
7
by: Carmine | last post by:
I need to import a huge .ixf file from a pc to db2 v7 zos. Is there a way to stop archive logging while the data is being imported? If not, is it safe to delete archive logs that haven't...
3
by: Oscar Thornell | last post by:
Hi, I am thinking about doing all my logging asynchronously using a delegate. The main resaon for this would be performance and responsiveness of the application (an ASP.NET app). //Exampel...
5
by: shsandeep | last post by:
Q 1. How do I come to know what type of logging has been enabled for a particular database (circular/archival,etc.) ? Q 2. DataStage is loading data into the tables. A parameter has been set...
0
by: Roman Ziak | last post by:
I switched to Windows server and logs generated by my ISP are pathetic comparing to those from Apache. I would like to do logging via PHP and use the same log for visits and for PHP tracing. That...
5
by: IdleBrain | last post by:
I am trying to log the Application name, Method name, line number and column number whenever an exception is generated in an C# 2005 application using the following code. Problem is that the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.