You are here: Foswiki>Tasks Web>Item11026 (21 Dec 2014, GeorgeClark)Edit Attach

Item11026: "verbose mode" - framework for making FW detect and report bugs

Priority: Enhancement
Current State: Proposal Required
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: FoswikiLogger
Reported By: RichMorin
Waiting For:
Last Change By: GeorgeClark
Web software (eg, browsers, Foswiki) tends to be very accommodating, making a valiant effort to make sense out of mangled markup, etc. This is probably a Good Thing, in that it allows unskilled authors to generate reasonably-formatted web pages.

However, in some cases, this is not the behavior that an author or administrator might desire, eg:

  • An author wants to know why the page isn't working as expected.

  • An author wants to know if the page has any "submarine" problems.

  • An administrator would like to scan a set of pages for problems.

Many logging systems define "log levels" which indicate the severity of a message (eg, alert, debug, error, fatal, info, warning). Similarly, many language processors have settings which the programmer can adjust to control the topic(s) and level of error reporting.

I would like to see a reporting framework of this sort in Foswiki. Here are some general constraints/goals for its APIs:

  • Both pages and plugins should be able to make reporting calls.

  • Reporting calls should specify the problem type and/or level, along with enough supporting information to allow diagnosis.

  • The type and/or level parameter(s) should be settable by either wiki variables or an option on the URL.

  • The type and/or level parameter(s) should be readable by both pages and plugins.

  • It should be possible to direct reports in various ways (eg, to the generated HTML for the page, to a wiki page).

Clearly, just having such a framework is no guarantee that anyone will use it. However, not having the framework guarantees that almost nobody will detect and report problems.

-- RichMorin - 07 Aug 2011

FWIW we already have alert/debug/error/fatal etc. in Foswiki, see Foswiki::Func::writeEvent. The logger API is pluggable and so can events can be written to a database or external logging tool, etc. rather than just working/logs/foo.log

I understand the desire for this. Foswiki just quietly ignores things far too often, which is frustrating.

Sadly we've not really exploited the new logger API much, but for what it's worth, here are the mappings of the lib/Foswiki/Logger/ logger's log levels -> files:

 34 # Map from a log level to the root of a log file name
 35 our %LEVEL2LOG = (
 36     debug     => 'debug',
 37     info      => 'events',
 38     warning   => 'error',
 39     error     => 'error',
 40     critical  => 'error',
 41     alert     => 'error',
 42     emergency => 'error'
 43 );

-- PaulHarvey - 08 Aug 2011

The Foswiki::Func::eachEventSince provides an API for plugin authors to work with past events, but it would be nice to make them queryable somehow.

-- PaulHarvey - 08 Aug 2011

ah, yes, thanks for the reminder - I made a UI marco that added query search to part of this, but like so many things, there's more todo.

-- SvenDowideit - 14 Aug 2011

ItemTemplate edit

Summary "verbose mode" - framework for making FW detect and report bugs
ReportedBy RichMorin
SVN Range
AppliesTo Engine
Component FoswikiLogger
Priority Enhancement
CurrentState Proposal Required
TargetRelease n/a
ReleasedIn n/a
Topic revision: r4 - 21 Dec 2014, GeorgeClark
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