Is there an existing web application somewhere or an easy way to build one that re-serves the production log as an RSS feed or simple web开发者_如何学编程 page, etc.? (RoR 3.0.5) We'd like other people to be able to glance at the log like the would other content they're used to… Any help is appreciated. Thanks!
First & foremost: Keep in mind the production log file contains sensitive data. Serving it as a web page or rss feed, even when password-protected, is very rarely wise.
With that said, it wouldn't be difficult to do.
# Security suicide
def get_production_log
File.open(File.join(Rails.root, 'log', 'production.log')) do |log|
content = ''
while (line = log.gets)
content << line + "<br />"
end
end
content
end
To quote the apothecary from romeo & juliet: My poverty of StackOverflow points, but not my will, consents
精彩评论