Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit 6e3b633

Browse files
committed
More README
1 parent c3e0ce7 commit 6e3b633

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
3454
git commits and the created tag, and push the `.gem` file to
3555
[rubygems.org](https://rubygems.org).
3656
57+
3758
## Implementation notes
3859
3960
References used when building this:

0 commit comments

Comments
 (0)