Print Page | Close Window

Logfile suggestion

Printed From: LogSat Software
Category: Spam Filter ISP
Forum Name: Spam Filter ISP Support
Forum Description: General support for Spam Filter ISP
URL: https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=5688
Printed Date: 03 November 2025 at 12:36pm


Topic: Logfile suggestion
Posted By: Roman
Subject: Logfile suggestion
Date Posted: 27 June 2006 at 6:45am
Hello Roberto,

Is it possible to open logfiles NON exclusevely for reading, but exclusevely for writing of course (as it does MS IIS, for example) so it will be possible to view it in real time by compatible viewers (I usually use FAR Manager for fast troubleshouting/monitoring)?

Thank you.



Replies:
Posted By: LogSat
Date Posted: 27 June 2006 at 1:28pm
Roman,

SpamFilter by default will update the logfile every 60 seconds. The logfile should not be locked by other applications, or that will prevent SpamFilter from writing to it. In theory opening the file for read-only access, and placing no locks on it should work, but this is really not tested...
We're actually working on writing logfiles in a slightly different way in the next 3.1 version, allowing "safer" access to 3rd party applications.


-------------
Roberto Franceschetti

http://www.logsat.com" rel="nofollow - LogSat Software

http://www.logsat.com/sfi-spam-filter.asp" rel="nofollow - Spam Filter ISP


Posted By: Roman
Date Posted: 27 June 2006 at 3:45pm
Roberto,

As I can see, SpamFilter opens logfile every 60 seconds, writes to it, and closes again. Therefore I can open this file for reading AND even for writing in this period. So when spamfilter tries to reopen it again - it can't place lock for writing and drops error in realtime logmonitor window.

Instead of Spamfilter IIS (as mentioned above) opens logfiles exclusively for writing, but do not block reading (may be not for writing, but "append", I don't remember the certain attributes in fopen() ). IIS don't close the file until it stops. So I can not open it for writing (while IIS works), but I can copy it and I can view it without preventing IIS to access the file. In fact I can even see how new lines are added to it in realtime without reopening the file.

I think, as long as Spamfilter does not need to read the logfile itself or write in voluntary position, it is enough to open logfile in "append" mode and do not close it while application runs. It's only a matter of changing attribute in fopen() and open-close-reopen-... sequence.


Posted By: Roman
Date Posted: 27 June 2006 at 3:57pm
This also allow 3rd party [web]log processing applications to access logfiles without copying it or blocking the running application.



Print Page | Close Window