-worker-id 1 2017-06-28T15:21:18.370+0900 INFO go-katsubushi/app.go:152 Listening at [::]:11212 2017-06-28T15:21:18.370+0900 INFO go-katsubushi/app.go:153 Worker ID = 1 Docker ͷ߹ڥมͰ $ docker run -p 11212:11212 -e worker_id=2 katsubushi/katsubushi 2017-06-29T05:58:39.847Z INFO go-katsubushi/app.go:152 Listening at [::]:11212 2017-06-29T05:58:39.848Z INFO go-katsubushi/app.go:153 Worker ID = 2
localhost 11212 STAT pid 1 STAT uptime 51014 STAT time 1498716107 STAT version 1.3.0 STAT curr_connections 1 STAT total_connections 8 STAT cmd_get 18 STAT get_hits 20 STAT get_misses 0 END
ʹઃఆ upstream katsubushi { server 127.0.0.1:11212; keepalive 10; } location /katsubushi { internal; set $memcached_key "id"; # keyͳΜͰOK memcached_pass katsubushi; } set $req_id 0; access_by_lua_block { local res = ngx.location.capture("/katsubushi") if res then ngx.var.req_id = res.body end }
$Log::Minimal::PRINT = sub { my ($time, $type, $message, $trace) = @_; my $req_id = $ENV{REQUEST_ID} // 0; warn "[$$][$req_id][$type] $message at $trace\n"; }; } warnf("something bad!"); [64302][329733861698727936][WARN] something bad! at .../App.pm line XX
identifier generated from 16 random bytes, in hexadecimal 4 ྫ: 9f53d64cf47dd966a7462f5a737b5ade ͍ ࣌ࠁใؚ͕·Εͳ͍ 4 http://nginx.org/en/docs/http/ngxhttpcoremodule.html#varrequest_id