1- # Akita::HarLogger
1+ # Akita HTTP Archive (HAR) logger for Rack applications
2+
3+ This provides Rack middleware for logging HTTP request–response pairs to a HAR
4+ file.
25
3- Rack middleware for logging HTTP request–response pairs to a HAR file.
46
57## Installation
68
@@ -18,9 +20,27 @@ Or install it yourself as:
1820
1921 $ gem install akita-har_logger
2022
23+
2124## Usage
2225
23- TODO: Write usage instructions here
26+ To instrument your Rack application, add ` Akita::HarLogger::Middleware ` to the
27+ top of your middleware stack. For convenience, you can use
28+ ` Akita::HarLogger.instrument ` , as follows.
29+
30+ 1 . In your main ` application.rb ` , make ` Akita::HarLogger ` available:
31+ ``` ruby
32+ require ' akita/har_logger'
33+ ```
34+ 2 . Add the following line to the bottom of your ` Rails::Application`
35+ subclass:
36+ ` ` ` ruby
37+ Akita::HarLogger.instrument(config, '/path/to/output/har_file.har')
38+ ` ` `
39+
40+ Now , when you run your Rack application, all HTTP requests and responses will
41+ be logged to the HAR file that you' ve specified. You can then upload this HAR
42+ file to Akita for analysis.
43+
2444
2545## Development
2646
@@ -34,6 +54,7 @@ release a new version, update the version number in `version.rb`, and then run
3454git commits and the created tag, and push the `.gem` file to
3555[rubygems.org](https://rubygems.org).
3656
57+
3758## Implementation notes
3859
3960References used when building this:
0 commit comments