Skip to content

Commit

Permalink
3.2.4. Move the log info data into fields to help other tools parse
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanramage committed Mar 4, 2016
1 parent a415928 commit 473724d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = function (config, log, since) {
if (!last_seen_seq) return process.exit(0)
jsonist.put(config.seq_url, {_meta: {seq: last_seen_seq }}, function (err, resp) {
if (err) log.error('Could not record sequence in elasticsearch', last_seen_seq, err)
else log.info({change: last_seen_seq}, 'stored in elasticsearch. ')
else log.info({type: 'checkpoint', seq: last_seen_seq}, 'stored in elasticsearch')
process.exit(0)
})

Expand All @@ -33,7 +33,7 @@ module.exports = function (config, log, since) {
log.error('error occured', type, _id, _rev, err)
return endTask()
}
log.info({change: seq}, 'success. ', type, _id, _rev, err)
log.info({type: 'change', seq: seq, change: type, id: _id, rev: _rev, err: err}, 'success')
checkpoint_counter++
if (!updating_checkpoint_counter && checkpoint_counter > config.checkpointSize) {
updating_checkpoint_counter = true
Expand All @@ -42,7 +42,7 @@ module.exports = function (config, log, since) {
jsonist.put(config.seq_url, {_meta: {seq: seq }}, function (err, resp) {
updating_checkpoint_counter = false
if (err) log.error('Could not record sequence in elasticsearch', seq, err)
else log.info({change: seq}, 'stored in elasticsearch. ')
else log.info({type: 'checkpoint', seq: last_seen_seq}, 'stored in elasticsearch')
return endTask()
})
}
Expand Down Expand Up @@ -141,7 +141,7 @@ module.exports = function (config, log, since) {
}

feed.on('confirm', function (info) {
log.info({change: feed.original_db_seq}, 'started')
log.info({type: 'start', seq: feed.original_db_seq}, 'started')
})

}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "couch2elastic4sync",
"version": "3.2.3",
"version": "3.2.4",
"description": "Sync couchdb data to elasticsearch.",
"main": "./lib/index.js",
"bin": "./bin/cli.js",
Expand Down

0 comments on commit 473724d

Please sign in to comment.