Releasing Locks on Log File

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Releasing Locks on Log File

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:28 pm

by Torrie >> Wed, 19 Nov 2003 10:28:10 GMT

I am writing log entries into a log file using the JadeLog class. I would like to force Jade to release the locks on the file or to roll over to a new log file.

Does anyone know how I could get Jade to do either of these?

Thanks

Torrie

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Releasing Locks on Log File

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:28 pm

by Brendan Doolan >> Wed, 19 Nov 2003 17:54:56 GMT

Torrie,
In Jade 6 there is a rollOverLog method on JadeLog, but it sounds like you are using Jade 5.2 in which case you may be stuffed.

Brendan

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Releasing Locks on Log File

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:28 pm

by cnwjhp1 >> Thu, 20 Nov 2003 1:06:46 GMT

Torrie,

You have to do something like this method that we use:

logMessage(s:String) updating;
/* Uses the JadeLog class to write a message to msg<n>.log */begin

if msgLog=null then
create msgLog;
msgLog.fileName:="msg";
msgLog.formatOutput:=false;
// msgLog.maxFileSize:=1000; // leave commented out to use value from ini file - doesn't work - Jade bug
msgLog.maxFileSize:=app.getProfileStringAppServer(app.getIniFileNameAppServe r,"JadeLog","MaxLogFileSize","1000000").Integer;
endif;
msgLog.log(actualTimeAppServer.logFormat&" "
&name&"/"&cnGetInstanceId(process).String&": "
&s&CrLf);
// delete msgLog;
end;

As I recall, to release (unlock) the file, you have to delete the JadeLog instance. We don't run this way. To get it to "version" correctly, you have to explicitly set msgLog.maxFileSize. The above code reads the current .ini file to get the appropriate value. This works in 5.2.

Cheers,
John P


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 20 guests

cron