diff options
author | Stan Hu <stanhu@gmail.com> | 2017-07-17 15:54:13 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-07-18 09:49:21 -0700 |
commit | e2b1c16ade09c0afde11d8b39bac9f1974c9b057 (patch) | |
tree | 8afe70ff4df1fcf3ba66d4f9fc4feacc310d76a7 /Gemfile | |
parent | 79dcaec6eddad2e5d370f9c4ecf2de24ff7980e8 (diff) | |
download | gitlab-ce-e2b1c16ade09c0afde11d8b39bac9f1974c9b057.tar.gz |
Add structured logging for Rails processessh-structured-logging
This introduces JSON logging for Rails views saved to a file called
`development_json.log`, `production_json.log`, etc.
For example, instead of this unparsable log:
```
Started GET "/" for 127.0.0.1 at 2012-03-10 14:28:14 +0100
Processing by HomeController#index as HTML
Rendered text template within layouts/application (0.0ms)
Rendered layouts/_assets.html.erb (2.0ms)
Rendered layouts/_top.html.erb (2.6ms)
Rendered layouts/_about.html.erb (0.3ms)
Rendered layouts/_google_analytics.html.erb (0.4ms)
Completed 200 OK in 79ms (Views: 78.8ms | ActiveRecord: 0.0ms)
```
We get a single line with this:
```
{"method":"GET","path":"/,"format":"html","controller":"HomeController","action":"index","status":200,"duration":79,"view":78.8,"db":0.0,"location":"http://localhost/","time":"2017-07-18 09:35:17 -0700"}
```
Part of #20060
Diffstat (limited to 'Gemfile')
-rw-r--r-- | Gemfile | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -390,3 +390,6 @@ gem 'toml-rb', '~> 0.3.15', require: false # Feature toggles gem 'flipper', '~> 0.10.2' gem 'flipper-active_record', '~> 0.10.2' + +# Structured logging +gem 'lograge', '~> 0.5' |