Plack 应用程序如何记录到多个记录器?
Plack 中间件非常有用,例如可以独立于应用程序配置日志记录目标。但我还没有找到同时使用多个记录器的方法:
my $app = MyApp->new();
builder {
enable 'ConsoleLogger'; # show in Client's console
enable 'SimpleLogger'; # show on STDERR
$app;
}
通过此配置,“SimpleLogger”被“ConsoleLogger”静音,但我想同时使用两个记录器进行记录。
Plack Middleware is very useful, for instance to configure logging targets independent of the application. But I have not found a method to use multiple loggers at the same time:
my $app = MyApp->new();
builder {
enable 'ConsoleLogger'; # show in Client's console
enable 'SimpleLogger'; # show on STDERR
$app;
}
With this configuration 'SimpleLogger' is muted by 'ConsoleLogger', but I want to log by both at the same time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
截至撰写本文时,您还不能。我一直在考虑有一个新的记录器中间件作为一种代理,将日志记录发送到多个中间件,但还没有任何费用来编写一个。
As of this writing you can't. I've been thinking about having a new logger middleware that acts as a sort of proxy, to dispatch logging to multiple middleware, but haven't got any tuit to write one.