如何清理我的Puma日志?

时间:2022-04-08 07:34:20

How do I clean up my rails logs so they don't show all this info about each individual asset fetched (particularly in development) and how long everything took? I'm using puma on rails 4.2.

如何清理我的rails日志,以便它们不会显示有关所获取的每个单独资产的所有信息(特别是在开发中)以及所有内容需要多长时间?我在轨道4.2上使用puma。

source=rack-timeout id=7b3b3f3cd8d64909db09 timeout=13000ms service=2ms state=active
Started GET "/assets_dev/logo.png" for 127.0.0.1 at 2015-08-14 09:29:29 -0400
source=rack-timeout id=7b3b3f3cd8d64909db09 timeout=13000ms service=35ms state=completed
source=rack-timeout id=bef678d34175fcacf2b6dd timeout=13000ms state=ready

source=rack-timeout id=bef678d34175fcacf2b6dd17 timeout=1300ms service=1ms state=active
Started GET "/assets_dev/fontawesome-webfont.woff?v=4.0.0" for 127.0.0.1 at 2015-08-14 09:29:29 -0400
source=rack-timeout id=bef678d34175fcacf2b6dd17 timeout=13000ms service=79ms state=completed
source=rack-timeout id=b60818b0635ab2765de8ab4c timeout=13000ms state=ready

source=rack-timeout id=b60818b0635ab2765de8ab4c timeout=13000ms service=1ms state=active

Started GET "/assets_dev/logo2.png" for 127.0.0.1 at 2015-08-14 09:29:29 -0400
source=rack-timeout id=b60818b0635ab2765de8ab4cb8928b40 timeout=13000ms service=80ms state=completed
source=rack-timeout id=b2839d080e992a9974d1984da0b1afcb timeout=13000ms state=ready

2 个解决方案

#1


0  

I'm assuming you mean narrow it down.

我假设你的意思是缩小范围。

The available log levels are: :debug, :info, :warn, :error, :fatal, and :unknown

可用的日志级别为:: debug,:info,:warn,:error,:fatal和:unknown

You can change the default by specifying it:

您可以通过指定来更改默认值:

config.log_level = :warn # In any environment initializer, or
Rails.logger.level = 0 # at any time

More info here

更多信息在这里

#2


0  

The gem quiet_assets quiets all that asset noise in the development log. To remove the puma timing info, one can enter Rack::Timeout::Logger.disable. Though it would be useful to have timing info when there's an error, so not sure if that makes sense to do in production.

gem quiet_assets在开发日志中平息所有资产噪声。要删除美洲狮时间信息,可以输入Rack :: Timeout :: Logger.disable。虽然在出现错误时有时间信息会很有用,但不确定在生产中是否有意义。

#1


0  

I'm assuming you mean narrow it down.

我假设你的意思是缩小范围。

The available log levels are: :debug, :info, :warn, :error, :fatal, and :unknown

可用的日志级别为:: debug,:info,:warn,:error,:fatal和:unknown

You can change the default by specifying it:

您可以通过指定来更改默认值:

config.log_level = :warn # In any environment initializer, or
Rails.logger.level = 0 # at any time

More info here

更多信息在这里

#2


0  

The gem quiet_assets quiets all that asset noise in the development log. To remove the puma timing info, one can enter Rack::Timeout::Logger.disable. Though it would be useful to have timing info when there's an error, so not sure if that makes sense to do in production.

gem quiet_assets在开发日志中平息所有资产噪声。要删除美洲狮时间信息,可以输入Rack :: Timeout :: Logger.disable。虽然在出现错误时有时间信息会很有用,但不确定在生产中是否有意义。