[ANN] ring.middleware.logger - Easy Ring Request Logging
I'm happy to announce ring.middleware.logger https://github.com/pjlegato/ring.middleware.logger, which logs details of each Ring request to a file, or to arbitrary functions you provide. The emphasis is on simplicity -- you can plug it in and go with sane out-of-the-box defaults, without any user configuration required. You can find it at https://github.com/pjlegato/ring.middleware.logger and on Clojars. I've been using it in production for several years, and it has now stabilized to the point where I feel comfortable announcing it to a wider audience. That said, it should be considered beta quality software -- API changes are unlikely, but there may be bugs. Feature suggestions and especially pull requests are welcome! You might like to use r.m.logger with its companion project, https://github.com/pjlegato/ring.middleware.conditional -- this allows you to activate any middleware selectively, based on arbitrary runtime state. For example, combining it with ring.middleware.logger, you can log only requests that have certain URI paths, certain IP addresses, or log selectively based any other condition you like. Best, Paul Legato -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Contrib.Logging enhancements: set-log-level!, spy for lazy sequences
On Apr 12, 2:46 pm, ataggart alexclojuregr...@gmail.com wrote: Providing a mechanism which is simple, and does what one expects (an open question) consistently across different backing implementations is not as easy as it may seem. Ideally, we can just cover the common base case, and expose machinery for the user to configure any non-standard situations as required. I imagine 80% of the time the logging library is used, the user is not going to be setting up any logging hierarchies of any kind. There should be a simple function that sets all logging levels to the given level to cover that 80% base case. People who need something more elaborate are going to be doing a lot of customization anyway... we don't need to cover every possible case, just the most common ones. The multiple backeds problem is indeed pretty annoying. The Clojure- level library would have to know about each and every backend and all its quirks to be able to do the right thing in every case... but isn't that the whole point of the abstraction layer? Where do we start? Are some backends more common than others? Best, Paul -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Contrib.Logging enhancements: set-log-level!, spy for lazy sequences
Hi, I'd like to suggest two enhancements to clojure-contrib.logging: 1) There should be an easy way to set the current log level threshold (DEBUG, WARN, etc.) I've written two set-log-level! functions which do this, at http://www.paullegato.com/blog/setting-clojure-log-level/ . I'm not sure why some Clojure instances return a org.apache.commons.logging.impl.Jdk14Logger and others a java.util.logging.LogManager$RootLogger from (impl-get-log ). Perhaps there's a better / more universal way to write the log level setting function than this? 2) The logging/spy macro doesn't print lazy sequences to the log; instead, it prints something like clojure.lang.LazySeq@8592. Since the user has explicitly requested that the sequence's value be logged, it makes sense to me to run the sequence and log the result. I've implemented this at http://www.paullegato.com/blog/lazy-spy-clojure-logging-lazy-sequences/. Again, I'm not sure if this is the best way to go about it. Suggestions or improvements would be greatly appreciated. Best, Paul -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en