Hello,
I have a web application deployed in multiprocess and multi-thread
scenario. ( 3 processes and 10 threads each).
I want to log search query string from users to a file called
todaysdate.log ...20091109.log
I'm using a python app but I can't get rsyslog in debian system to
catch and write my messages. Would you know how can I set this up?
Here is a sample test case....in python.
Save below to a file and run it.
python testfile.py
#----testfile.py-----
from logging.handlers import SysLogHandler
import logging
# create logger
logger = logging.getLogger("myapp")
logger.setLevel(logging.DEBUG)
ch = SysLogHandler('/dev/log')
ch.setLevel(logging.DEBUG)
# create formatter
formatter = logging.Formatter("%(asctime)s - %(name)s-%(levelname)s -
%(message)s")
# add formatter to ch
ch.setFormatter(formatter)
logger.addHandler(ch)
logger.info('This is a message')
How can I setup rsyslog to filter "myapp" and save the messages to a
file in /home/lucas/myapp/20091109.txt
Thanks,
Lucas
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com