473,402 Members | 2,053 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.

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 1751

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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.