Skip to content

airframe-http: #399 Add a standard JSON request logger#1073

Merged
xerial merged 13 commits intowvlet:masterfrom
xerial:http-request-log
May 13, 2020
Merged

airframe-http: #399 Add a standard JSON request logger#1073
xerial merged 13 commits intowvlet:masterfrom
xerial:http-request-log

Conversation

@xerial
Copy link
Copy Markdown
Member

@xerial xerial commented May 12, 2020

Adding a standard http request/response logger so that airframe-http applications always have proper logging.

This will close #399

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2020

Codecov Report

Merging #1073 into master will decrease coverage by 0.08%.
The diff coverage is 76.99%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1073      +/-   ##
==========================================
- Coverage   82.40%   82.31%   -0.09%     
==========================================
  Files         268      270       +2     
  Lines       10148    10258     +110     
  Branches      651      670      +19     
==========================================
+ Hits         8362     8444      +82     
- Misses       1786     1814      +28     
Impacted Files Coverage Δ
...la/wvlet/airframe/http/finagle/FinagleServer.scala 72.83% <63.63%> (-3.17%) ⬇️
...rame/http/finagle/filter/HttpAccessLogFilter.scala 74.39% <74.39%> (ø)
...rame/http/finagle/filter/HttpAccessLogWriter.scala 94.11% <94.11%> (ø)
...vlet/airframe/http/finagle/filter/CorsFilter.scala 100.00% <100.00%> (ø)
...e-log/jvm/src/main/scala/wvlet/log/io/IOUtil.scala 97.29% <100.00%> (+0.07%) ⬆️
...c/main/scala/wvlet/airframe/http/HttpMessage.scala 79.61% <0.00%> (-1.20%) ⬇️
...shared/src/main/scala/wvlet/log/io/StopWatch.scala 80.00% <0.00%> (-0.21%) ⬇️
...in/scala/wvlet/airframe/http/finagle/package.scala 96.36% <0.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c10a735...acfe315. Read the comment docs.

@xerial xerial force-pushed the http-request-log branch from 926eef4 to b201c6d Compare May 12, 2020 20:37
Comment thread airframe-http/README.md
libraryDependencies += "org.wvlet.airframe" %% "airframe-http-finagle" % (version)
```

## Defining HTTP Endpoints
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc has moved to docs/airframe-http.md

Comment thread docs/airframe-http.md Outdated
@xerial
Copy link
Copy Markdown
Member Author

xerial commented May 13, 2020

CI is failing because of some GitHub Action issue.

Copy link
Copy Markdown
Collaborator

@shimamoto shimamoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

m += "remote_host" -> request.remoteAddress.getHostAddress
m += "remote_port" -> request.remotePort

m.result
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nice to have user_agent. Just a thought

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. user_agent can be read from HTTP headers, so it's already recorded.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

@takezoe takezoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding HttpErrorLogger!

@xerial xerial merged commit 22716fb into wvlet:master May 13, 2020
@xerial xerial deleted the http-request-log branch May 13, 2020 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add default http access log filter to airframe-http

3 participants