Item8742: Logger in some instances fails because the Log setting was not "expanded"
Priority: Normal
Current State: Closed
Released In:
Target Release: n/a
Applies To: Engine
Component: Logger
Branches:
When bin/configure needs to access topics, such as when checking in topics or attachments under revision control, the Meta object logs the topic changes using the Logger.
Because bin/configure has loaded the $Foswiki environment with "expand" disabled, the variables are loaded without expansion resulting in the logger filename being set to:
$Foswiki::cfg{Log}{Dir} = '$Foswiki::cfg{WorkingDir}/logs';
And calls to log topic changes result in a System failure - unable to write to
$Foswiki::cfg{WorkingDir}/logs/warn.txt
I've been able to work around this issue through two changes:
- Set
dontlog
option on the Meta, and Meta attachment calls.
- Clear
$Foswiki::cfg{ConfigurationFinished}
before creating the new Foswiki instance
except for Windows. The only thing I've found that works consistently in Windows, is to have the Logger routines call
Foswiki::Configure::Load::expandValue
before using the $log file.
There has to be a better way - but this one works.
--
GeorgeClark - 22 Mar 2010
Actually, I don't see anything wrong with your solution. Just so long as you make it clear to the reader
why dontlog
is set, it seems reasonable not to log these calls.
As such, I'm closing this.
--
CrawfordCurrie - 05 Jun 2010