Skip to content

Commit 5ead52b

Browse files
committed
Update README.md
1 parent 7ba5482 commit 5ead52b

1 file changed

Lines changed: 21 additions & 48 deletions

File tree

README.md

Lines changed: 21 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,10 @@ http://www.stackify.com/sign-up/
1212

1313
Requirements: Ruby 1.9/2.0/2.1, Rails 3.x/4.x
1414

15-
## Installation
16-
17-
TODO
15+
## Installation and Configuration
1816

1917
### Rails
2018

21-
TODO
22-
23-
### Non-Rails
24-
25-
TODO
26-
27-
## Configuration
28-
29-
TODO
30-
31-
## Log API Usage
32-
33-
TODO
34-
35-
## Metrics API Usage
36-
37-
TODO
38-
39-
40-
Rails Installation
41-
------------------
42-
43-
### Rails 3.x/4.x
44-
4519
Add the stackify gem to your Gemfile. In Gemfile:
4620

4721
gem 'stackify-api-ruby'
@@ -50,7 +24,7 @@ Run the bundle command to install it:
5024

5125
$ bundle
5226

53-
Or install it manually:
27+
or install it manually:
5428

5529
$ gem install stackify-api-ruby
5630

@@ -60,21 +34,7 @@ After you install stackify-api-ruby you need to run the generator:
6034

6135
The generator creates a file 'config/initializers/stackify.rb' configuring stackify-api-ruby with your API key. You can change default settings there.
6236

63-
Usage: Logging
64-
------------------
65-
### Rails Environment
66-
67-
stackify-api-ruby starts with start of Rails. Every error, which occurs within your application, will be caught and sent to Stackify automatically. The same situation with logs - you just use the Rails logger as usual:
68-
69-
Rails.logger.info "Some log message"
70-
71-
If you want to redefine <b>logger</b>, you should add
72-
73-
config.logger = ::Stackify::LoggerProxy.new(ActiveSupport::Logger.new(File.join(Rails.root, 'log', "#{Rails.env}.log")))
74-
75-
to your config/environments/%environment%. <b>Note:</b> in this case Stackify#config.log_level will affect entire system.
76-
77-
### Other Environment
37+
### Non-Rails
7838

7939
For using stackify-api-ruby gem within any Ruby application add to top of your main file:
8040

@@ -86,10 +46,9 @@ After that you need to make base configuration:
8646
config.api_key = "your_api_key"
8747
config.env = :development
8848
config.app_name = "Your app name"
89-
config.app_location = "/somewhere/public"
9049
end
9150

92-
"api_key" - it's you key for Stackify. "app-location" - it's location of your application for Nginx/Apache(for Nginx it's value of 'root', for Apache it's value of 'DocumentRoot' at config files).
51+
## Optional Configuration
9352

9453
Gem has 3 modes of work - "both", "logging", "metrics". Mode "both" turns on both parts of gem - logging and metrics.
9554
If you need ONLY logging or metrics use "logging" or "metrics" mode accordingly.
@@ -100,18 +59,32 @@ If you want to use proxy for sending request, you can do it in such way:
10059

10160
config.proxy = { uri: '127.0.0.1:8118', user: 'user_name', password: 'some_password' }
10261

62+
## Log API Usage
63+
64+
### Rails
65+
66+
stackify-api-ruby starts with start of Rails. Every error, which occurs within your application, will be caught and sent to Stackify automatically. The same situation with logs - you just use the Rails logger as usual:
67+
68+
Rails.logger.info "Some log message"
69+
70+
If you want to redefine <b>logger</b>, you should add
71+
72+
config.logger = ::Stackify::LoggerProxy.new(ActiveSupport::Logger.new(File.join(Rails.root, 'log', "#{Rails.env}.log")))
73+
74+
to your config/environments/%environment%. <b>Note:</b> in this case Stackify#config.log_level will affect entire system.
75+
76+
### Non-Rails
77+
10378
After logs configuring you should wrap up your logger:
10479

10580
logger = Logger.new('mylog.log')
10681
logger = Stackify::LoggerProxy.new(logger)
10782

108-
10983
And last thing you need to do - call method "run":
11084

11185
Stackify.run #remember that this call is running in the background of your main script
11286

113-
Usage: Metrics
114-
------------------
87+
## Metrics API Usage
11588

11689
There are four different types of metrics:
11790

0 commit comments

Comments
 (0)