<p>I've been playing with RSS feeds this week, and for my next trick I want to build one for our internal application log.  We have a centralized database table that our myriad batch and intranet apps use for posting log messages.  I want to create an RSS feed off of this table, but I'm not sure how to handle the volume- there could be hundreds of entries per day even on a normal day.  An exceptional make-you-want-to-quit kind of day might see a few thousand.  Any thoughts?</p>

[{'answer_id': 60061, 'author': 'Simon Johnson', 'author_id': 854, 'author_profile': 'https://Stackoverflow.com/users/854', 'pm_score': 0, 'selected': False, 'text': '<p>Without knowing your application, I can\'t offer specific advice. </p>\n\n<p>That said, it\'s common in these sorts of systems to have a level of severity. You could have a query string parameter that you tack on to the end of the URL that specifies the severity. If set to "DEBUG" you would see every event, no matter how trivial. If you set it to "FATAL" you\'d only see the events that that were "System Failure" in magnitude. </p>\n\n<p>If there are still too many events, you may want to sub-divide your events in to some sort of category system. Again, I would have this as a query string parameter. </p>\n\n<p>You can then have multiple RSS feeds for the various categories and severities. This should allow you to tune the level of alerts you get an acceptable level. </p>\n'}, {'answer_id': 64297, 'author': 'Joel Coehoorn', 'author_id': 3043, 'author_profile': 'https://Stackoverflow.com/users/3043', 'pm_score': 0, 'selected': False, 'text': '<p>Okay, I decided how I\'m gonna handle this.  I\'m using the timestamp field for each column and grouping by day.  It takes a little bit of SQL-fu to make it happen since of course there\'s a full timestamp there and I need to be semi-intelligent about how I pick the log message to show from within the group, but it\'s not too bad.  Further, I\'m building it to let you select which application to monitor, and then showing every message (max 50) from a specific day.</p>\n\n<p>That gets me down to something reasonable.</p>\n\n<p>I\'m still hoping for a good answer to the more generic question:  "How do you syndicate many important messages, where missing a message could be a problem?"</p>\n'}, {'answer_id': 64338, 'author': 'James Aylett', 'author_id': 6302, 'author_profile': 'https://Stackoverflow.com/users/6302', 'pm_score': 2, 'selected': False, 'text': "<p>If you are building a system with notifications that must not be missed, then a pub-sub mechanism (using XMPP, one of the other protocols supported by ApacheMQ, or something similar) will be more suitable that a syndication mechanism. You need some measure of coupling between the system that is generating the notifications and ones that are consuming them, to ensure that consumers don't miss notifications.</p>\n\n<p>(You can do this using RSS or Atom as a transport format, but it's probably not a common use case; you'd need to vary the notifications shown based on the consumer and which notifications it has previously seen.)</p>\n"}, {'answer_id': 65759, 'author': 'Joel Coehoorn', 'author_id': 3043, 'author_profile': 'https://Stackoverflow.com/users/3043', 'pm_score': 0, 'selected': False, 'text': "<p>In this case, it's more of a manager's dashboard:  how much work was put into support today, is there anything pressing in the log right now, and for when we first arrive in the morning as a measure of what went wrong with batch jobs overnight.</p>\n"}, {'answer_id': 82859, 'author': 'Paweł Hajdan', 'author_id': 9403, 'author_profile': 'https://Stackoverflow.com/users/9403', 'pm_score': 2, 'selected': False, 'text': "<p>I would make the feed a <strong>static file</strong> (you can easily serve thousands of these), <strong>regenerated periodically</strong>. Then you have a much broader choice, because it doesn't have to run below second, it can run even minutes. And users still get <strong>perfect download speed</strong> and reasonable update speed.</p>\n"}, {'answer_id': 421550, 'author': 'Steve Losh', 'author_id': 13498, 'author_profile': 'https://Stackoverflow.com/users/13498', 'pm_score': 1, 'selected': False, 'text': "<p>I'd split up the feeds as much as possible and let users recombine them as desired.  If I were doing it I'd probably think about using Django and the syndication framework.</p>\n\n<p>Django's models could probably handle representing the data structure of the tables you care about.</p>\n\n<p>You could have a URL that catches everything, like: <code>r'/rss/(?(\\w*?)/)+'</code> (I think that might work, but I can't test it now so it might not be perfect).</p>\n\n<p>That way you could use URLs like (edited to cancel the auto-linking of example URLs):</p>\n\n<ul>\n<li>http:// feedserver/rss/batch-file-output/</li>\n<li>http:// feedserver/rss/support-tickets/</li>\n<li>http:// feedserver/rss/batch-file-output/support-tickets/ (both of the first two combined into one)</li>\n</ul>\n\n<p>Then in the view:</p>\n\n<pre><code>def get_batch_file_messages():\n    # Grab all the recent batch files messages here.\n    # Maybe cache the result and only regenerate every so often.\n\n# Other feed functions here.\n\nfeed_mapping = { 'batch-file-output': get_batch_file_messages, }\n\ndef rss(request, *args):\n    items_to_display = []\n    for feed in args:\n        items_to_display += feed_mapping[feed]()\n    # Processing/returning the feed.\n</code></pre>\n\n<p>Having individual, chainable feeds means that users can subscribe to one feed at a time, or merge the ones they care about into one larger feed.  Whatever's easier for them to read, they can do.</p>\n"}]
['https://Stackoverflow.com/questions/60009', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3043/']