Remote logging for react native and redux store on top of elastic-search kibana dashboard. Features:
- Bulk updates to save bandwidth
- Indexing data by key(clientId)
- Offline support
- Created for redux and thunk
- Entries are composed by the action value
- Time based, automatically timestamp per entry
npm install --save react-native-remote-logger
cat examples/Counters/src/createStore.js ✓ 11211 00:06:36
// @flow
import { createStore, applyMiddleware, combineReducers } from 'redux'
import thunk from 'redux-thunk'
// 2. Import the classes
import { RemoteLogger, RemoteLoggerReduxMid } from 'react-native-remote-logger'
import { app } from './modules'
// 3. Configure your client
const RemoteLoggerClient = new RemoteLogger({
maxPerRequest: 10,
clientId: 'counter',
endpoint: 'https://.us-west-2.es.amazonaws.com/_bulk'
});
// 4. Appened the curry utility to the middleware of your redux store
const middleware = applyMiddleware(thunk, RemoteLoggerReduxMid.bind(null, RemoteLoggerClient))
export default (data: Object = {}) => {
const rootReducer = combineReducers({
//every modules reducer should be define here
[app.NAME]: app.reducer
})
return createStore(rootReducer, data, middleware)
}
maxPerRequest: Integer, How many entries would you like to bulk per request clientId: String, Elastic Search Index endpoint: Strig, URL of your elastic search debug: bool, Set to true to show in the inspector the entry value
Update the elastic search index
Curry function for the Middleware
Create a new instance in less than 5 minutes here: https://aws.amazon.com/elasticsearch-service/
- Go to management > Index Patterns > Create index pattern
- Write down the client id which is the index pattern
- Go to Discover > search the recently created index pattern
https://www.youtube.com/watch?v=k73ifeAnLVg&feature=youtu.be