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 1 1778
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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 controversial but personally I'm
very happy to see such a full-featured logger as part of the standard
distribution. Here's my problem though (using 2.3.3) - I'm trying to write
some reusable classes that _optionally_ use the logging module. So a class...
|
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 GotDotNet Workspace, has been released as an individual
package.
Dotnet Commons Logging provides a unified Log interface that acts as a
|
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 %(function)s, which results in
the name
of the entity which logged the record. My version even deduces the
class name in the case which the logger is a bound method, and assuming
the name of the "self" variable is indeed "self".
|
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 runs?
I would like to setup the logging so that there is no logging when
nothing is configured, and no warning messages are printed.
Thomas
|
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 expired?
Thanks.
| |
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
delegate void LogDelegate(string message);
LogDelegate logger = new LogDelegate(Log.Debug);
logger.DynamicInvoke("Some message..");
|
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 into
it to commit every 1000 rows. How to verify whether the commit is
happening every 1000 rows on the database side?
Thanks.
|
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 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...
|
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 line number that is being obtained by
stackFrame.GetFileLineNumber() represents AnotherForm.LogMessage
function's line number. I am trying to write the line number of the
statement which is causing an exception and not the LogMessage
function's line...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |