Anybody know what the filter or a config line would be that would filter my "myapp" messages to a file in /home/lucas/20091112.txt?
Ideas? Thanks, Lucas On Tue, Nov 10, 2009 at 7:02 PM, Lukasz Szybalski <[email protected]> wrote: > 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 > -- Setup CalendarServer for your company. http://lucasmanual.com/mywiki/CalendarServer Automotive Recall Database - See if you vehicle has a recall http://lucasmanual.com/recall _______________________________________________ rsyslog mailing list http://lists.adiscon.net/mailman/listinfo/rsyslog http://www.rsyslog.com

