Papertrail의 무료 버전이 꽉 차서 필터를 하기로 했습니다.Rails/heroku

4213 단어 HerokupapertrailRails
블로그를 업데이트했습니다원래 기사는 코코아였어요.
heroku+Rails로 개발하면 다양한 추가 모듈이 있어 편리합니다.로그도 Papertrail을 사용해서 좋았지만'10MB가 넘었고 무료 버전이 끝났다'고 해서 로그를 잠시 삭제하기로 했습니다.
나는 일부 로그를 취소할 방법을 찾지 못했다.글쎄, 어차피 블로그 일지도 중요하지 않으니까 전부 삭제하기로 했어.삭제 버튼은 없지만 heroku에서 Papertrail의 추가 모듈을 삭제하면 0부터 사용할 수 있습니다.제한 없어요?
Rails 로그가 너무 많아서 금방 또 꽉 찰 것 같아서 시간을 끌게요.기본적으로 중요하지 않은 로그도 많이 저장되어 있습니다.
예를 들면 이거.
Jan 21 12:26:48 yourapp app/web.1:    Rendered goog0px_02.html.erb (0.1ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered goog0px_02.html.erb (0.1ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered google/_ad_posts.html.erb (0.1ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered google/_ad_posts.html.erb (0.1ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered omment.html.erb (0.0ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered omment.html.erb (0.0ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered posts/show.html.erb withs/application (107.0ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered posts/show.html.erb withs/application (107.0ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered header.html.erb (7.1ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered header.html.erb (7.1ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered g_728px.html.erb (0.1ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered g_728px.html.erb (0.1ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered sharedessage.html.erb (0.1ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered sharedessage.html.erb (0.1ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered post_posts.html.erb (8.8ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered post_posts.html.erb (8.8ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered posts/_posts.html.erb (10.8ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered posts/_posts.html.erb (10.8ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered goog0px_01.html.erb (0.1ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered goog0px_01.html.erb (0.1ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered sharh_form.html.erb (0.6ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered sharh_form.html.erb (0.6ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered post_posts.html.erb (1.0ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered post_posts.html.erb (1.0ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered posts/_posts.html.erb (1.9ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered posts/_posts.html.erb (1.9ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered sdebar.html.erb (24.9ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered sdebar.html.erb (24.9ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered footer.html.erb (0.1ms) 
Jan 21 12:26:48 yourapp app/web.1:    Rendered footer.html.erb (0.1ms) 
많은 템플릿을 사용했기 때문에 대량의 렌더링된 로그가 나왔다.매번 제기되는 것도 곤란하니 거르자.
Papertrail의 추가 모듈에서 Account/Settings를 보면 Filter Unnecssary Logs가 있습니다. 그렇지만 정규 표현식에서 필요하지 않은 로그를 필터해서 간격을 맞출 수 있습니다.
Rails 응용 프로그램을 변경하면 새 Gem을 넣지 않아도 Papertrail에서 설정할 수 있어 편리합니다.
Rendered
그래서 위에 열거한 일지는 모두 공제되었다.
그렇게 지워지면 골치 아프니 정규 표현식으로 쓰면 돼.
예를 들면 아래.
www\d+ \W: (Rendered|\/assets)
그렇다면 이것은 무엇을 의미하는지... 정규 표현식은 설명하지 않지만... 이런 느낌.

오히려 이해하기 힘들어?로그에 이런 느낌의 문자열이 있으면 찾으십시오.
  
PostController의 렌더링 로그만 간격을 두고 싶다면, 이런 느낌인가요?
app\/web.\d:    Rendered posts\/
 
각종 실험을 하려면 이 사이트가 가장 좋다.
http://rubular.com/
Your teststring: 에 Rails의 로그를 삽입하여 다양한 터치를 하면 목표 로그를 잡는 정규 표현식을 알 수 있습니다.
이렇게 하면 깨끗하고 상쾌해진다!
일지 보는 게 즐거워졌어.. 없나.
http://workabroad.jp/posts/2041

좋은 웹페이지 즐겨찾기