node-ecstatic
node-ecstatic copied to clipboard
Add a logging option
I don't know if I'm the only one who needs this, but because ecstatic is my main development server, I often wish I could see the requests in the console. I would like to be able to enable it with a simple CLI flag.
For log format I was thinking something like https://en.wikipedia.org/wiki/Common_Log_Format
Yeah I could get behind a simple CLF-based logging format
How about we integrate morgan? It offers a variety of log formats.
@mk-pmb interesting. I'll take a look
Example code for ecstatic stacked with logging.
I think it's a reasonable stance to say that ecstatic's logging should be extremely lightweight and intended for stdout only. If this means pulling in a module this is OK, but should definitely not overengineer this. If a tiny custom class works just as well, we should consider that as well.
Alternatively, we could consider implementing a very light-weight sub-middleware chaining mechanism inside the middleware function we return, so people can plug whatever logging and more. (Yo dawg, I heard you like middleware…)
idk about sub-middlewares (I've been toying with the idea of moving away from express middleware support for well over a year now anyway), but a log property on the existing middleware to hook onto would make a lot of sense.