You are not logged in Log in Join
You are here: Home » Members » Zen » Logger » Logger Product Information » View Document

Log in
Name

Password

 

Logger Product Information

Logger

The Logger product defines the <dtml-log> DTML tag, allowing us to send messages to Zope's Log system from DTML.

Syntax

log tag syntax:

    <dtml-log [severity=string] [subsystem=string] [exception]>
        [...]
    [<dtml-logdetail>]
        [...]
    </dtml-log>

    The 'log' and 'logdetail' sections can contain arbitrary DTML, which
    is parsed and sent to the Zope logging subsystem.

Attributes

severity=string
Message severity passed to the Zope logging subsystem. It is case insensitive, and can be one of:
BLATHER
Somebody shut this app up.

TRACE

DEBUG

INFO
For things like startup and shutdown.
PROBLEM
This isn't causing any immediate problems, but deserves attention.
WARNING
A wishy-washy alias for PROBLEM.
ERROR
This is going to have adverse effects.
PANIC
We're dead!
subsystem=string
Any string of your choosing, used to help identify where log messages originated from
exception
If set, the exception currently being handled is formatted (including the full traceback) and appended to the details of the message. This attribute has no effect if an exception is not being handled.

Note that depending on your current Zope logging system, some parameters may not be used and low severity messages may be silently dropped. For example, when using Syslog logging as documented in doc/LOGGING.txt, the subsytem parameter and the logdetail messages appear to have no effect, and BLATHER severity messages are silently dropped.

Examples

eg:

   <dtml-log>Log this mesage!</dtml-log>

   <dtml-log severity=INFO subsystem=MyApp>
      This is some logged text!
   <dtml-logdetail>
     This is the detail section of the log.
     See doc/LOGGING.txt for details.
   </dtml-log>

   <dtml-log severity=blather>Current namespace: <dtml-var id></dtml-log>

   <dtml-try>
     [...]
   <dtml-except>
     <dtml-log severity=ERROR exception>
        Error doing stuff, so here is the traceback as well
     </dtml-log>
   </dtml-except>

Transactions

Even if a Zope transaction is aborted, log tags that have already been parsed will have been sent to the Logging system and will not be rolled back. This is desirable, as it makes this tag useful for debugging DTML code.

Author, Licence & Disclaimer

This software was written by Stuart Bishop <zen@shangri-la.dropbear.id.au> 11 Oct 1999 and is released under a BSD style licence. The author makes no promises as to the suitability of this software for any purpose whatsoever and can not be held liable for any direct or indirect effects of its use, including but not limited to spontaneous human combustion.

Updates to this software will be made available on Zope.org.

$Id: README.txt,v 1.6 2002/04/22 04:28:34 zen Exp $