Closed ghost closed 9 years ago
For the first place, what logs are you talking about? By default, Caveman2 and Clack don't output any kind of error logs in development environment (invokes CL debugger instead).
I saw setting envy to production and debug to nil stops debugger, but hunched toot supports writing Web Access logs to a file for analytics. Analytics are important for websites, maybe caveman2 can write the access logs to a file via a key param?
Caveman2 uses Clack.Middleware.Accesslog for displaying access logs. You can specify the log-level in app.lisp of your project skeleton which was generated by Caveman2.
(if (productionp)
nil
(make-instance '<clack-middleware-accesslog>
:log-level :info))
Since Clack.Middleware.Accesslog uses Log4CL, all facilities of it are also available for it. For instance, you can configure to output access logs to a file by adding an appender to clack.middleware.accesslog:*access-logger*
.
https://github.com/7max/log4cl/blob/master/README.md#appenders
Nice, thanks!
For local development, I'd like to disable error logging to the main slime repl (it gets bogged down with async requests firing off).
Is it possible to set error logging to a file? I saw something about logger-min-level, but this value isn't available in the main caveman2 package file (main.lisp) created.
By default, Hunchentoot has keyed parameters to set in their #'start call - since some of your keys match (port etc.) it may be nice to update clack with a new key(s) like :logger-min-level, so it can be controlled on server start up.