{"id":337,"date":"2012-10-29T09:33:48","date_gmt":"2012-10-29T00:33:48","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=337"},"modified":"2018-11-14T16:33:59","modified_gmt":"2018-11-14T07:33:59","slug":"sys-logger","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2012\/10\/29\/sys-logger\/","title":{"rendered":"Ruby\u7528syslog\u30e9\u30c3\u30d1\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u66f8\u3044\u3066\u307f\u305f"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u5bfa\u5ca1\u3067\u3059\u3002<\/p>\n<p>\u6700\u8fd1\u3001\u3068\u3042\u308b\u6848\u4ef6\u3067\u3053\u3093\u306a\u8981\u671b\u304c\u4e0a\u304c\u3063\u3066\u6765\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>Rails\u3067syslog\u3092\u4f7f\u3063\u3066\u30ed\u30b0\u306b\u51fa\u529b\u3059\u308b<\/li>\n<li>\u4efb\u610f\u306efacility\u3092\u6307\u5b9a\u3057\u305f\u3044<\/li>\n<\/ul>\n<p>Ruby\u3067syslog\u3092\u6271\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u3057\u3066\u3001SyslogLogger\u306a\u3069\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001<br \/>\n\u3053\u308c\u3089\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u306f\u6e80\u305f\u305b\u306a\u3044\u8981\u4ef6\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u81ea\u4f5c\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<h2>syslog\u30e9\u30a4\u30d6\u30e9\u30ea\u8abf\u67fb<\/h2>\n<p>syslog\u3092logger\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30b9\u3067\u6271\u3048\u308b\u30e9\u30c3\u30d1\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u3001<s>\u7d1b\u3089\u308f\u3057\u3044<\/s>\u3088\u304f\u4f3c\u305f\u540d\u524d\u306e\u3082\u306e\u304c\u3044\u3063\u3071\u3044\u3042\u3063\u305f\u308a\u3057\u307e\u3059\u3002<br \/>\n\u305d\u306e\u4e2d\u306e\u6570\u500b\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u304c\u3001facility\u304c\u8a2d\u5b9a\u3067\u304d\u306a\u3044\u3082\u306e\u3084\u3001faclity\u306e\u8a2d\u5b9a\u306f\u3067\u304d\u308b\u3082\u306e\u306e\u3001\u521d\u3081\u3066\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u304c\u547c\u3073\u51fa\u3055\u308c\u305f\u6642\u3060\u3051\u6709\u52b9\u3067\u30012\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u76ee\u4ee5\u964d\u306f\u7121\u8996\u3055\u308c\u308b\u3082\u306e\u306a\u3069\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u666e\u6bb5\u306f\u56f0\u3089\u306a\u3044\u306e\u3067\u3059\u304c\u3001Unicorn\u306a\u3069\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d0\u3068Rails\u304c\u51fa\u529b\u3059\u308b\u30ed\u30b0\u306efacility\u3092\u5206\u3051\u305f\u3044\u5834\u5408\u306a\u3069\u30011\u30d7\u30ed\u30bb\u30b9\u3067\u8907\u6570\u306efacility\u3092\u4f7f\u3044\u5206\u3051\u305f\u3044\u3001\u3068\u3044\u3063\u305f\u8981\u671b\u306b\u5bfe\u5fdc\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<h2>\u3068\u3044\u3046\u308f\u3051\u3067\u3001\u4f5c\u3063\u3066\u307f\u305f<\/h2>\n<p><a href=\"https:\/\/github.com\/techscore\/sys_logger\">sys_logger<\/a> \u3068\u3044\u3046gem\u3092\u4f5c\u3063\u3066\u516c\u958b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u3053\u308c\u3067\u6674\u308c\u3066<s>\u7d1b\u3089\u308f\u3057\u3044<\/s>\u3088\u304f\u4f3c\u305f\u540d\u524d\u30b0\u30eb\u30fc\u30d7\u306e\u4ef2\u9593\u5165\u308a\u3067\u3059\u306d\uff01<br \/>\n\u2026\u2026\u3044\u3044\u540d\u524d\u304c\u601d\u3044\u304b\u305a\u306b\u3064\u3044\u3084\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002\u30b4\u30e1\u30f3\u30ca\u30b5\u30a4\u3002<\/p>\n<p>sys_logger\u3092\u4f7f\u3048\u3070\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3054\u3068\u306bfacility\u3092\u8a2d\u5b9a\u3057\u305f\u308a\u3001facility\u3092\u9014\u4e2d\u3067\u5909\u66f4\u3067\u304d\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>Rails3\u3067\u5229\u7528\u3059\u308b\u306b\u306fapplication.rb\u306a\u3069\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u3059\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">module YourAppName\r\n  class Application &lt; Rails::Application\r\n    # ...\r\n    config.logger = SysLogger.new('rails', SysLogger::LOG_LOCAL0)\r\n    # ...\r\n  end\r\nend<\/pre>\n<p>github\u3084rubygems\u3092\u4f7f\u3046\u3068\u3001\u3061\u3087\u3063\u3068\u3057\u305f\u30b3\u30fc\u30c9\u3067\u3082\u6c17\u8efd\u306b\u516c\u958b\u3067\u304d\u308b\u306e\u3067\u4fbf\u5229\u3067\u3059\u306d\u3002<br \/>\n\u3053\u308c\u304b\u3089\u3082\u8272\u3005\u4f5c\u3063\u3066\u516c\u958b\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\uff01\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u5bfa\u5ca1\u3067\u3059\u3002<\/p>\n<p>\u6700\u8fd1\u3001\u3068\u3042\u308b\u6848\u4ef6\u3067\u3053\u3093\u306a\u8981\u671b\u304c\u4e0a\u304c\u3063\u3066\u6765\u307e\u3057\u305f\u3002<br \/>\n\u30fbRails\u3067syslog\u3092\u4f7f\u3063\u3066\u30ed\u30b0\u306b\u51fa\u529b\u3059\u308b<br \/>\n\u30fb\u4efb\u610f\u306efacility\u3092\u6307\u5b9a\u3057\u305f\u3044<\/p>\n<p>ruby\u3067syslog\u3092\u6271\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u3057\u3066\u3001SyslogLogger\u306a\u3069\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001<br \/>\n\u3053\u308c\u3089\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u306f\u6e80\u305f\u305b\u306a\u3044\u8981\u4ef6\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u81ea\u4f5c\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<br \/><a href=\"https:\/\/www.techscore.com\/blog\/2012\/10\/29\/sys-logger\/\">\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[22,24,34],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/337"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=337"}],"version-history":[{"count":1,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/337\/revisions"}],"predecessor-version":[{"id":18025,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/337\/revisions\/18025"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}