Commit b005c94b authored by Dave Cooper's avatar Dave Cooper
Browse files

added flexible aserve :after method for logging

parent 0814efa5
......@@ -28,11 +28,11 @@
(defvar *log-file* nil)
(defun start-log-maker (&key (interval 30) (resolve-dns? t))
(defun start-log-maker (&key (interval 30) (resolve-dns? t) (server net.aserve:*wserver*))
(setq *log-file* (format nil "/home/dcooper8/kitchen/logs-~a-~a.lisp"
(gwl::iso-time (get-universal-time))
(slot-value (slot-value gwl::*wserver* 'net.aserve::socket) 'socket::local-port)))
(slot-value (slot-value server 'net.aserve::socket) 'socket::local-port)))
......@@ -75,6 +75,14 @@
(defmethod net.aserve::log-request :after ((req http-request))
(dolist (function *aserve-log-request-after-functions*)
(funcall function req)))
(defparameter *aserve-log-request-after-functions* nil)
(defmethod monkey-log ((req http-request))
(when *log-file*
(let* ((ipaddr (socket:remote-host (request-socket req)))
(end-time (net.aserve::request-reply-date req))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment