[Zope] log files
Dunigan, Craig
craig.dunigan@esker.com
Fri, 11 May 2001 14:38:05 -0500
Hi Fritz,
> is this the only way to use stupid_log_files?
>
> "
> $ python1.5.2 z2.py ZSYSLOG_SERVER="syslog.mydomain.com:514" \
> STUPID_FILE_LOGGER=var/Zope.log"
> "
>
> i got this from: http://www.zope.org/Documentation/Misc/LOGGING.txt
> or can i put this in a config file? i looked inside z2.py and
> found no place
> to put it.
>
Well, sort of. First of all, as noted here
http://lists.zope.org/pipermail/zope/2000-February/103384.html,
STUPID_FILE_LOGGER is incorrect (somebody really ought to fix that). The
correct environment variable name is STUPID_LOG_FILE. Secondly, I'm not
sure it makes sense to turn on both local and remote logging as (it seems to
me) this example does. I'll address the local logging, since that's the
only one I'm sure of. Since you don't want to turn it on all the time (eats
up resources and slows down your production server), the best way to enable
it is to set this environment variable somewhere, like perhaps your ./start
script, something like:
#! /bin/sh
reldir=`dirname $0`
PYTHONHOME=`cd $reldir; pwd`
export PYTHONHOME
STUPID_LOG_FILE=/$PYTHONHOME/var/Zope.log
export STUPID_LOG_FILE
exec /$PYTHONHOME/bin/python \
$PYTHONHOME/z2.py "$@"
then when you want to start debug logging, run zope like this:
./start -D &
For more logging options, there's also a -M switch for verbose logging in
z2.py, with a nice (wow, brand new as I was writing this!) utility available
here http://www.zope.org/Members/mcdonc/HowTos/DEBUG-LOG, for analysis.
> what am i supposed to expect here? i tried the command line
> approach but i
> was looking for the file and i don't think it create the
> file. or is it
> gonna be create when the first error comes?
You got nothing for two reasons. One, you followed instructions and
unfortunately set the wrong environment variable. Two, you probably didn't
turn on debugging by launching zope with the -D switch. Don't forget to
background it with the &, because -D causes zope _not_ to detach from the
console when starting. And at the risk of sounding repetitious, running a
production site with the -D switch is not recommended procedure. Do it to
collect information, then turn it off when you have enough.
>
>
> Fritz Mesedilla
> Systems Administrator
>
> Summit Interactive, Inc.
> FHM | Seventeen | Candy | Cosmopolitan | Preview | Good Housekeeping
> femalenetwork.com | candymag.com | fhm.com.ph | cosmo.com.ph
> --------------------------------------------------------------
> --------------
> http://contemplation401.tripod.com +Basta
> Ikaw Lord
>
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
>
Craig Dunigan
Web Programmer
Esker Software - Extending the Reach of Information
mailto:craig.dunigan@esker.com
Ph. 608.273.6000
Fax 608.273.8227
http://www.esker.com