Ah, I get it now.  I'm trying to move application.log and server.log, 
and if you try to rename those in file explorer (even as administrator) 
you get the "Cannot rename application: It is being used by another 
person or program".

Is there a way to manually truncate these logs WITHOUT restarting the 
services?  Or do we have to refactor the whole way we parse logs to deal 
with these locked files?

All I want to do is archive the log (which i already can do) and 
truncate the existing application.log/session.log (which i can't).

(I realize there are other ways to do this - like to train my parser to 
recognize the datestamps and to set a low tolerance for log size in 
CFAdmin - but this is just the way the app is written now so I'd like to 
get it to work as-is if at all possible)

Thanks again,
-Jeff

Jeff Congdon wrote:

>I'm at a loss with some file handling difficulties on my setup (MX 6.11, 
>IIS, win2k3 server) and am now looking for some advice. 
>
>I'm converting a 'cf log parser' app that we've had running in cf5.  It 
>reads the log, parses, looks for certain events which it aggregates and 
>inserts to a db, then renames the log file.
>
>Everything works up until the rename function, where the real fun begins.
>
><CFFILE action="rename" source="\\#currentserver#\#logdir#\#log#.log" 
>destination="\\#currentServer#\#logdir#\#log#.#yesterday_FileExt#">
>
>i know all of these variables resolve (and resolve properly), yet I get 
>this error:  FWIW, i've tried it with the nameconflict = "overwrite" 
>attribute as well, and get the same error.
>
>Attribute validation error for tag CFFILE.
>The value of the attribute source, which is currently 
>"\\www1\logs\application.log", is invalid.
>
>It's not invalid though, clearly.  The path works in other CFFILE tags 
>in the same page, and works on the server itself through windows file 
>explorer.  I've read that this error comes up when you have *other* 
>things wrong with the tag and have action="rename",  but I'm very 
>confident that all variables resolve properly and all paths exist.
>
>So I gave up on rename, and decided to copy and then delete the log.  
>Copy works FINE with the exact same parameters:
>
><cffile action="COPY" source="\\#currentserver#\#logdir#\#log#.log" 
>destination="\\#currentServer#\#logdir#\#log#.#yesterday_FileExt#">
><cffile action="DELETE" file="\\#currentserver#\#logdir#\#log#.log">
>
>Here the file copies just fine, but doesn't delete.  So i try to catch 
>the delete error...
>                  
><cftry>
><cffile action="DELETE" file="\\#currentServer#\#logDir#\#log#.log">
>  <cfcatch type="any">
> - CANNOT DELETE FILE <cfoutput> 
>\\#currentServer#\#logDir#\#log#.log</cfoutput>- 
> </cfcatch>
></cftry>
>
>Still the file copies, but doesn't delete.  But there's no error?!?!  
>the catch block never triggers, and the page maintains that it executed 
>properly, despite the fact that the file is never deleted.
>
>So... does anybody know what's going on?
>
>Thanks,
>-Jeff
>
>
>
>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211918
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to