Item8742: Logger in some instances fails because the Log setting was not "expanded"

pencil
Priority: Normal
Current State: Closed
Released In:
Target Release: n/a
Applies To: Engine
Component: Logger
Branches:
Reported By: GeorgeClark
Waiting For:
Last Change By: CrawfordCurrie
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:
  1. Set dontlog option on the Meta, and Meta attachment calls.
  2. 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

 

ItemTemplate edit

Summary Logger in some instances fails because the Log setting was not "expanded"
ReportedBy GeorgeClark
Codebase trunk
SVN Range
AppliesTo Engine
Component Logger
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:6a732c18f3d7
TargetRelease n/a
ReleasedIn
Topic revision: r3 - 05 Jun 2010, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy