README.md in logdna-1.0.1 vs README.md in logdna-1.0.2
- old
+ new
@@ -7,12 +7,12 @@
</p>
---
* **[Installation](#installation)**
+* **[Quick Setup](#quick-setup)**
* **[API](#api)**
-* **[Development](#development)**
* **[Contributing](#contributing)**
* **[License](#license)**
# Installation
@@ -42,15 +42,16 @@
to set up the logger.
Options are optional variables that may contain hostname, app name, mac address, ip address, log level specified.
options = {
- :hostname => myHostName
- :ip => myIpAddress
- :mac => myMacAddress
- :app => myAppName
+ :hostname => myHostName,
+ :ip => myIpAddress,
+ :mac => myMacAddress,
+ :app => myAppName,
:level => "INFO" # LOG_LEVELS = ['TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL'] or your customized log level
+ :env => "PRODUCTION"
}
To send logs, use "log" method.
@@ -69,24 +70,24 @@
logger.log('This is warn message', {:level => "WARN"})
You can also send a metadata with your message by specifying 'meta' field
- logger.log('This is a message with metadata', {:meta => {:once => {:first => {"nested1", "nested2"}, "second"}}, :level => "TRACE"})
+ logger.log('This is a message with metadata', {:meta => {:once => {:first => "nested1", :another => "nested2"}}, :level => "TRACE"})
Hostname and app name cannot be more than 80 characters.
+You can search logs by environment in a form of 'env:staging' or '_env:staging' in logdna search bar.
# Important Notes
1. This logger assumes that you pass in json formatted data
2. This logger is a singleton (do not create mutiple instances of the logger) even though the singleton structure is not strongly enforced.
-
# API
## Logdna::Ruby.new(ingestion_key, options = {})
Instantiates a new instance of the class it is called on. ingestion_key is required.
@@ -96,9 +97,10 @@
|{ :hostname => Host name } | Device's default hostname |
|{ :mac => MAC address } | Nil |
|{ :ip => IP address } | Nil |
|{ :app => App name } | 'default' |
|{ :level => Log level } | 'INFO' |
+|{ :env => STAGING, PRODUCTION .. etc} | Nil |
|{ :flushtime => Log flush interval in seconds } | 0.25 seconds |
|{ :flushbyte => Log flush upper limit in bytes } | 500000 bytes ~= 0.5 megabytes |
Different log level displays log messages in different colors as well.
- ![TRACE DEBUG INFO Colors](https://placehold.it/15/515151/000000?text=+) "Trace" "Debug" "Info"