How can I stop Plack printing access log to STDERR

miyagawa edited this page Oct 11, 2010 · 2 revisions

Short answer: Use --access-log option, or run your app with plackup -E deployment app.psgi and enable AccessLog middleware by your own

When you use the plackup tool to run your application, it by default prints access log to standard error. This is because plackup by default enable some middleware components, one of which is AccessLog.

You can specify the file path to the log file with --access-log command line option so it prints access log to a file rather than standard error.

You can specify command line option for plack environment (-E) value other than development, like -E deployment to disable these default middleware components, and enable your own AccessLog configuration to do stuff like syslog integration.

See perldoc plackup and perldoc Plack::Middleware::AccessLog for more details.