Hi there,
I am stuck while trying to use the logging facilities. Its not logging
:-) Can somebody point me to a solution ?
The following snipplets are used
-------------------------------------------
"crap.py"
logging.config. fileConfig("log ging.cfg")
logger = logging.getLogg er ("syslog")
logger.info('Wh ile this is just chatty')
-------------------------------------------
"logging.cf g"
[syslog]
class=handlers. SysLogHandler
level=ERROR
formatters=form 01
facility=LOG_LO CAL0
priority = LOG_INFO
[formatters]
keys=form01
[formatter_form0 1]
format=%(leveln ame)s %(message)s
-------------------------------------------
"/etc/syslog.conf"
local0.*;local0 .!=debug /var/log/local.log
local0.=debug /var/log/local-d.log
Kind regards
Michael 9 5633
michael wrote: Hi there,
I am stuck while trying to use the logging facilities. Its not logging :-) Can somebody point me to a solution ?
The following snipplets are used
------------------------------------------- "crap.py"
logging.config. fileConfig("log ging.cfg") logger = logging.getLogg er ("syslog") logger.info('Wh ile this is just chatty')
------------------------------------------- "logging.cf g"
[syslog] class=handlers. SysLogHandler level=ERROR formatters=form 01 facility=LOG_LO CAL0 priority = LOG_INFO
[formatters] keys=form01
[formatter_form0 1] format=%(leveln ame)s %(message)s
------------------------------------------- "/etc/syslog.conf"
local0.*;local0 .!=debug /var/log/local.log local0.=debug /var/log/local-d.log
Kind regards
Michael
I'm taking a wild guess here(io. I haven't tested your code), but I
don't think you can expect a logger of level ERROR to logg messages of
level INFO. Try setting your log level to INFO.
regards
/rune
michael wrote: Hi there,
I am stuck while trying to use the logging facilities. Its not logging :-) Can somebody point me to a solution ?
The following snipplets are used
------------------------------------------- "crap.py"
logging.config. fileConfig("log ging.cfg") logger = logging.getLogg er ("syslog") logger.info('Wh ile this is just chatty')
------------------------------------------- "logging.cf g"
[syslog] class=handlers. SysLogHandler level=ERROR formatters=form 01 facility=LOG_LO CAL0 priority = LOG_INFO
[formatters] keys=form01
[formatter_form0 1] format=%(leveln ame)s %(message)s
------------------------------------------- "/etc/syslog.conf"
local0.*;local0 .!=debug /var/log/local.log local0.=debug /var/log/local-d.log
The config file appears incomplete - can you post the whole of it (if
it's not too big)? I would have expected to see lines like
[loggers]
keys=root
[handlers]
keys=syslog
[logger_root]
level=DEBUG
qualname=(root)
handlers=syslog
[handler_syslog]
class=handlers. SysLogHandler
level=ERROR
formatter=form0 1
host=localhost
port=handlers.S YSLOG_UDP_PORT
facility=LOG_LO CAL0
args=(('localho st', handlers.SYSLOG _UDP_PORT),
handlers.SysLog Handler.LOG_LOC AL0)
(the args line may wrap in this mail)
You can't encode the priority in the config file - it is automatically
determined from the logging level (e.g. INFO -> LOG_INFO).
Note that the SysLogHandler communicates with the syslog daemon via UDP
and there may be network problems preventing the messages getting to the
server. If in doubt, format a UDP packet and send directly from a Python
script (i.e. not via logging) to confirm that there is no network problem.
Best regards,
Vinay Sajip
Vinay Sajip <vi*********@re d-dove.com> wrote in message news:<ma******* *************** *************** *@python.org>.. . The config file appears incomplete - can you post the whole of it (if it's not too big)? I would have expected to see lines like
Yep it was incomplete heres the complete config as it has to be
[loggers]
keys=root,syslo g
[handlers]
keys=syslog,fil e,stdout
[logger_syslog]
qualname=syslog
level=INFO
handlers=syslog
[logger_root]
qualname=root
level=INFO
handlers=stdout
[handler_syslog]
class=handlers. SysLogHandler
level=ERROR
formatter=syslo g
args=(('localho st', handlers.SYSLOG _UDP_PORT), handlers.SysLog Handler.LOG_USE R)
[handler_stdout]
class=StreamHan dler
level=INFO
formatter=stdou t
args=(sys.stdou t,)
[handler_file]
class=FileHandl er
level=INFO
formatter=stdou t
args=('python.l og', 'w')
[formatters]
keys=syslog,std out
[formatter_syslo g]
format=%(module )s %(levelname)s %(message)s
[formatter_stdou t]
format=%(module )s %(asctime)s %(levelname)s %(message)s
Thanks for the help
Michael
michael wrote: Yep it was incomplete heres the complete config as it has to be
[config file snipped]
The complete file looks OK. Did you take into account the comment
roderik made (about levels - does it work if you set the logger and
handler levels both to DEBUG)? And have you checked that there is no
network problem?
Best regards,
Vinay Sajip
Vinay Sajip <vi*********@re d-dove.com> wrote in message news:<ma******* *************** *************** *@python.org>.. . michael wrote: Yep it was incomplete heres the complete config as it has to be [config file snipped]
The complete file looks OK.
Thx. with this file it is working. The syslogd configuration under AIX was buggy.
regards
Michael
Slightly OT, but regarding the title, shouldn't it be PEBKAC, since it's
keyboard and not ceyboard?
Regards,
Jan
michael wrote: Vinay Sajip <vi*********@re d-dove.com> wrote in message news:<ma******* *************** *************** *@python.org>.. .
michael wrote:
Yep it was incomplete heres the complete config as it has to be
[config file snipped]
The complete file looks OK.
Thx. with this file it is working. The syslogd configuration under AIX was buggy.
regards
Michael
Jan Dries <ja*******@dcub e-resource.be> writes: Slightly OT, but regarding the title, shouldn't it be PEBKAC, since it's keyboard and not ceyboard?
Your computer didn't come with a ceyboard? :)
--
Lloyd Zusman lj*@asfast.com
God bless you.
Jan Dries <ja*******@dcub e-resource.be> wrote in message news:<ma******* *************** *************** *@python.org>.. . Slightly OT, but regarding the title, shouldn't it be PEBKAC, since it's keyboard and not ceyboard?
PEBCAC: Problem Exists Between Chair And Computer
[Jan Dries] Slightly OT, but regarding the title, shouldn't it be PEBKAC, since it's keyboard and not ceyboard?
[Vinay Sajip] PEBCAC: Problem Exists Between Chair And Computer
Interesting. I thought it was "Problem Exists Between Keyboard And Chair".
But this makes sensee too, of course. Nonetheless, Google has about 17000
references for PEBKAC, and only 381 for PEBCAC.
Regards,
Jan This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Doug Fort |
last post by:
Hi,
Perhaps this is as much a Unix question as a Python question.
I really like the Python logging module, and I've used it extensively,
with good results. Now I have a requirement to add a SysLogHandler, and
it's just not working. It looks like the socket is connecting, but nothing
comes out on the log. (Fedora Core 2 /var/log/messages)
The simplest of many configurations I have tried is included below.
|
by: Marty |
last post by:
It seems all of the sudden that user controls that
contain images are referencing image sources relative to
the document that I drop the control on. This obviously
does not work beacuase the image source is relative to
the user control, not necessarily the form. Can anyone
tell me why this would be the case?
|
by: Simon Harris |
last post by:
Ok, this really is driving me nuts!!! :(
'All' I am trying to do is get the value of a named element. My XML doc
is:
<?xml version="1.0" encoding="utf-16" standalone="yes" ?>
- <Page>
<Title>Test</Title>
<MetaKeywords>Test</MetaKeywords>
|
by: trond |
last post by:
Hello all,
Before I start I'd like to point out that I am a complete novice when
it comes to asp.net - My background is in network and operating
systems, and although I have been doing a bit of hobby programming in
vb.net and web programming in asp/vbscript in the past, I am pretty
much a beginner at asp.net.
What I'm trying to do, is to take the "PersonalHomePage" starter kit
that MS supplies with VS2005 and tweak it a bit, to make it...
|
by: Johnny Emde |
last post by:
Hello Newsgroup
I'm about going nuts!!!
Sometime when I coding a asp.net (using C#) I'll get this wierd error.
Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.
| |
by: Marty |
last post by:
Hi,
I hope you can help me with this one (my code is below my message).
I have many clients connecting to my server. When any of them
disconnect, something happen.
This user get disconnect from the server and this is fine. But
sometime, I can't reproduce exactly the situation (maybe the client
crashed), the related socket in server seems to get nuts and still think
|
by: windandwaves |
last post by:
Hi
I have the following file:
--myfile.php
<?php
if($s) {
echo $s;
session_id($s);
session_start;
|
by: Nicholas Milkovits |
last post by:
Hello all,
I have a small script which attempts to write to the user.log syslog
import logging, logging.handlers
logger = logging.getLogger('bender')
handler = logging.handlers.SysLogHandler(('localhost',
logging.handlers.SYSLOG_UDP_PORT),
logging.handlers.SysLogHandler.LOG_USER)
|
by: MarkOlbert |
last post by:
When I run the following under Python 3.1:
import logging
from logging.handlers import SysLogHandler
logger = logging.getLogger('TestLogger')
logger.setLevel(logging.DEBUG)
handler = logging.handlers.SysLogHandler(address='/dev/log')
logger.addHandler(handler)
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |