Re: [Zope-dev] Syslog logger broken?

2004-08-04 Thread Paul Winkler
I could really use some help with this one.
Does anybody have:

A) an /etc/syslog.conf that definitely works
for logging messages from python's syslog logger?

B) a simple python script that exercises A?

I decided to check whether something was wrong with my syslog
configuration; i now suspect there may be, because 
I have been unable to get anything into syslog via python at all.
Here is my non-working test script, derived from the example
in the python standard lib docs at
http://docs.python.org/lib/node301.html :

import logging
logger = logging.getLogger('myapp')
hdlr = logging.handlers.SysLogHandler()
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr) 
logger.setLevel(logging.WARNING)
logger.error('We have a problem')
logger.info('While this is just chatty')


And here is my attempt at logging everything to a new syslog file,
this is in /etc/syslog.conf:

# XXX
*.* -/var/log/pw_testing.log



On Tue, Aug 03, 2004 at 12:07:33AM -0400, Paul Winkler wrote:
> On Sun, Aug 01, 2004 at 06:20:19AM +0200, Andreas Jung wrote:
> > 
> > 
> > --On Samstag, 31. Juli 2004 23:37 Uhr -0400 Paul Winkler 
> > <[EMAIL PROTECTED]> wrote:
> > 
> > >Has anybody had success with the syslog logger in Zope 2.7.0 or later?
> > >AFAICT the example in zope.conf.in is borken.
> > >See http://collector.zope.org/Zope/1425
> > >
> > >Andreas assigned it to me, but I really have no clue
> > >how to fix it.
> > >
> > >
> > 
> > hm...according to your report only the entries in the example are 
> > broken...maybe I have to
> > re-read again..
> 
> Yes, please do :-)
> >From the bug report:
> 
> """
> The following is what I guess to be correct based on 
> zLOG/component.xml, and it raises no errors, but I don't see any 
> output either (maybe it's a problem with my /etc/syslog.conf):
> 
> 
>level all
>   
>  address localhost:514
>   
> 
> """
> 
> -- 
> 
> Paul Winkler
> http://www.slinkp.com
> ___
> Zope-Dev maillist  -  [EMAIL PROTECTED]
> http://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope )

-- 

Paul Winkler
http://www.slinkp.com
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Syslog logger broken?

2004-08-02 Thread Paul Winkler
On Sun, Aug 01, 2004 at 06:20:19AM +0200, Andreas Jung wrote:
> 
> 
> --On Samstag, 31. Juli 2004 23:37 Uhr -0400 Paul Winkler 
> <[EMAIL PROTECTED]> wrote:
> 
> >Has anybody had success with the syslog logger in Zope 2.7.0 or later?
> >AFAICT the example in zope.conf.in is borken.
> >See http://collector.zope.org/Zope/1425
> >
> >Andreas assigned it to me, but I really have no clue
> >how to fix it.
> >
> >
> 
> hm...according to your report only the entries in the example are 
> broken...maybe I have to
> re-read again..

Yes, please do :-)
>From the bug report:

"""
The following is what I guess to be correct based on 
zLOG/component.xml, and it raises no errors, but I don't see any 
output either (maybe it's a problem with my /etc/syslog.conf):


   level all
  
 address localhost:514
  

"""

-- 

Paul Winkler
http://www.slinkp.com
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Syslog logger broken?

2004-07-31 Thread Paul Winkler
Has anybody had success with the syslog logger in Zope 2.7.0 or later?
AFAICT the example in zope.conf.in is borken.
See http://collector.zope.org/Zope/1425 

Andreas assigned it to me, but I really have no clue
how to fix it. 

-- 

Paul Winkler
http://www.slinkp.com
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] syslog

2001-10-03 Thread Jerome Alet

On Wed, 3 Oct 2001, Toby Dickenson wrote:

> On Mon, 1 Oct 2001 20:53:00 +0200, Jerome Alet <[EMAIL PROTECTED]> wrote:
> >
> >It may prove to be useful when you want to do remote logging: you
> >send all to the local syslog which in fact forwards it to a remote 
> >syslog server.
> 
> I understand the interest for remote logging of events - thats what I
> am using syslog for.
> 
> Does the same apply to access logs too? (that is, the entries which
> also get written to var/Z2.log)

Sorry, I don't know. In fact I don't use syslog with Zope, this was just a
general answer. Because Apache is often used in front of Zope, it's
probably even better (quicker) to let Apache do the access logging and
disable it entirely from Zope. 

bye,

Jerome Alet


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] syslog

2001-10-03 Thread Toby Dickenson

On Mon, 1 Oct 2001 20:53:00 +0200, Jerome Alet <[EMAIL PROTECTED]> wrote:

>On Mon, Oct 01, 2001 at 04:14:47PM +0100, Toby Dickenson wrote:
>> 
>> A question for all syslog users; is it ever useful to send access logs to
>> syslog? (I can't think of good reason, but my syslog zen quotient is still
>> low). Is anyone else even using syslog?
>
>It may prove to be useful when you want to do remote logging: you
>send all to the local syslog which in fact forwards it to a remote 
>syslog server.

I understand the interest for remote logging of events - thats what I
am using syslog for.

Does the same apply to access logs too? (that is, the entries which
also get written to var/Z2.log)

Toby Dickenson
[EMAIL PROTECTED]

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] syslog

2001-10-01 Thread Jerome Alet

On Mon, Oct 01, 2001 at 04:14:47PM +0100, Toby Dickenson wrote:
> 
> A question for all syslog users; is it ever useful to send access logs to
> syslog? (I can't think of good reason, but my syslog zen quotient is still
> low). Is anyone else even using syslog?

It may prove to be useful when you want to do remote logging: you
send all to the local syslog which in fact forwards it to a remote 
syslog server.

hth.

Jerome Alet

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



RE: [Zope-dev] syslog

2001-10-01 Thread Toby Dickenson

> I'll admit that I don't know.  The ZLogger module makes some 
> noise about 
> syslog, but I dont even know if and when that module is used 
> (as opposed 
> to the zLOG module).

It is actually always used unless Zope is started read-only. Its not easy to
follow *how* this happens - and I am still not sure *why* its done this way.

As for the how:

 ZLogger starts out with a from zLog import *,
 it then sets up the list of standard logger
 objects, and defines the log_write function.

 Later, z2.py transplants the log_write function
 from ZLogger into zLOG, where it is used by
 the implementation of zLOG.LOG (the usual 
 logging API)

>  Have you verified this by trying it?

Definitely yes - my syslog filled up with access log information.

A question for all syslog users; is it ever useful to send access logs to
syslog? (I can't think of good reason, but my syslog zen quotient is still
low). Is anyone else even using syslog?


Anyway, for anyone else interested, below a patch so that the configuration
of access-syslog uses different environment variables to event-syslog. 


Index: z2.py
===
RCS file: /home/cvs/development/external/Zope2/z2.py,v
retrieving revision 1.14
diff -c -2 -r1.14 z2.py
*** z2.py   10 Sep 2001 15:32:28 -  1.14
--- z2.py   1 Oct 2001 14:35:43 -
***
*** 635,646 
  if READ_ONLY:
  lg = logger.file_logger('-') # log to stdout
! elif os.environ.has_key('ZSYSLOG'):
! lg = logger.syslog_logger(os.environ['ZSYSLOG'])
! if os.environ.has_key("ZSYSLOG_FACILITY"):
! lg =
logger.syslog_logger(os.environ['ZSYSLOG'],facility=os.environ['ZSYSLOG_FACI
LITY'])
  else:
! lg = logger.syslog_logger(os.environ['ZSYSLOG'])
! elif os.environ.has_key('ZSYSLOG_SERVER'):
! (addr, port) = string.split(os.environ['ZSYSLOG_SERVER'], ':')
  lg = logger.syslog_logger((addr, int(port)))
  else:
--- 635,646 
  if READ_ONLY:
  lg = logger.file_logger('-') # log to stdout
! elif os.environ.has_key('ZSYSLOG_ACCESS'):
! lg = logger.syslog_logger(os.environ['ZSYSLOG_ACCESS'])
! if os.environ.has_key("ZSYSLOG_ACCESS_FACILITY"):
! lg =
logger.syslog_logger(os.environ['ZSYSLOG_ACCESS'],facility=os.environ['ZSYSL
OG_FACILITY'])
  else:
! lg = logger.syslog_logger(os.environ['ZSYSLOG_ACCESS'])
! elif os.environ.has_key('ZSYSLOG_ACCESS_SERVER'):
! (addr, port) = string.split(os.environ['ZSYSLOG_ACCESS_SERVER'],
':')
  lg = logger.syslog_logger((addr, int(port)))
  else:

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] syslog

2001-10-01 Thread Chris McDonough

I'll admit that I don't know.  The ZLogger module makes some noise about 
syslog, but I dont even know if and when that module is used (as opposed 
to the zLOG module).  Have you verified this by trying it?

Toby Dickenson wrote:
> I am looking to configure my Zope to use syslog for the first time.
> 
> I see that 2.4 uses the same environment variables to control whether
> syslog is used for access logs and event logs. This seems like a bad
> idea to me; the two log sources have completely different purposes,
> and I dont think it is possible to separate the two using syslog
> rules.
> 
> Am I missing something?
> 
> Toby Dickenson
> [EMAIL PROTECTED]
> 
> ___
> Zope-Dev maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
> 


-- 
Chris McDonoughZope Corporation
http://www.zope.org http://www.zope.com
"Killing hundreds of birds with thousands of stones"


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] syslog

2001-10-01 Thread Toby Dickenson

I am looking to configure my Zope to use syslog for the first time.

I see that 2.4 uses the same environment variables to control whether
syslog is used for access logs and event logs. This seems like a bad
idea to me; the two log sources have completely different purposes,
and I dont think it is possible to separate the two using syslog
rules.

Am I missing something?

Toby Dickenson
[EMAIL PROTECTED]

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )