Syslog

G

greg

Hi All,

Could anyone tell me how I could syslog to a specific log (e.g. /var/
log/daemon.log, /var/log/syslog.log...)?

Thanks very much in advance!

-Greg
 
H

Hamish Moffatt

greg said:
Could anyone tell me how I could syslog to a specific log (e.g. /var/
log/daemon.log, /var/log/syslog.log...)?

Thanks very much in advance!

It's up to your syslogd to route messages into particular files, based
on their facility and/or priority. Check out /etc/syslog.conf or
equivalent on your system.


Hamish
 
M

Michael Bentley

Hi All,

Could anyone tell me how I could syslog to a specific log (e.g. /var/
log/daemon.log, /var/log/syslog.log...)?

# something like this:

import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(levelname)-8s %(message)s',
datefmt='%a, %d %b %Y %H:%M:%S',
filename='/var/log/whatever.log',
filemode='a')

logging.info('random message')

hth,
Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top