Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alphasights/event_logger
A really tiny event logger for sending events to elastic search
https://github.com/alphasights/event_logger
Last synced: 5 days ago
JSON representation
A really tiny event logger for sending events to elastic search
- Host: GitHub
- URL: https://github.com/alphasights/event_logger
- Owner: alphasights
- License: mit
- Created: 2015-09-18T19:39:07.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-20T21:13:34.000Z (about 9 years ago)
- Last Synced: 2024-04-14T07:25:15.570Z (7 months ago)
- Language: Ruby
- Size: 195 KB
- Stars: 0
- Watchers: 49
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# EventLogger
![CircleCI Build Status](https://circleci.com/gh/alphasights/event_logger.svg?style=shield&circle-token=:circle-token)
A really tiny event logger for sending events to elastic search
## Installation
Add this line to your application's Gemfile:
```ruby
gem "event_logger", git: "[email protected]:alphasights/event_logger.git"
```And then execute:
$ bundle install
## Usage
To setup a logger:
```ruby
logger = EventLogger::Logger.new(
application: "brazil",
environment: "development",
host: "https://elasticsearch.dev:9200",
)
```To send an event:
```ruby
logger.event!(interaction_id: 12345,
type: :analyst_picked_up,
timestamp: Time.new(2012, 1, 2, 3, 4, 5, "-06:00"),
twilio_code: "12345",
attempts: 2,
advisor: { name: "John Bohn", email: "[email protected]", phone: "555-521-6937" },
client: { name: "A Client", email: "[email protected]", phone: "555-344-1790" },
analyst: { name: "Sandy Reid", email: "[email protected]", phone: "555-813-8113" })
```Dates and times will automatically be transformed to iso8601 strings
(the original hash you pass in won't be mutated though).## Contributing
1. Fork it ( https://github.com/alphasights/event_logger/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am "Add some feature"`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request