Closed thomasp85 closed 6 years ago
@cpsievert can you comment on whether this will suit your requirements?
Sounds good, but depends on what's in the event
/message
...right now I'm just logging information about requests like this (this is the default for Flask):
server$on("after-request", function(server, id, request, ...) {
msg <- sprintf(
'%s - - [%s] "%s %s HTTP/1.1" %s',
request$host, Sys.time(), request$method,
request$path, request$response$status
)
cat(msg, "\n")
})
Hi @cpsievert - can you check out what I got brewing in #19 and see if there is any shortcomings or additional needs you can think of...
Need to come up with a flexible API for handling of logging.
Current idea: Fire gets a
log(event, message)
method and all internals will call it. Thelog
method will dispatch the logging to a user defined logger which can write to a db, output to console, etc. If none exists it will be a zero-operation...