{"action":"closed","issue":{"url":"https://api.github.com/repos/winstonjs/winston/issues/673","labels_url":"https://api.github.com/repos/winstonjs/winston/issues/673/labels{/name}","comments_url":"https://api.github.com/repos/winstonjs/winston/issues/673/comments","events_url":"https://api.github.com/repos/winstonjs/winston/issues/673/events","html_url":"https://github.com/winstonjs/winston/issues/673","id":96691267,"number":673,"title":"writing logs in loop","user":{"login":"mackenza","id":2412637,"avatar_url":"https://avatars.githubusercontent.com/u/2412637?v=3","gravatar_id":"","url":"https://api.github.com/users/mackenza","html_url":"https://github.com/mackenza","followers_url":"https://api.github.com/users/mackenza/followers","following_url":"https://api.github.com/users/mackenza/following{/other_user}","gists_url":"https://api.github.com/users/mackenza/gists{/gist_id}","starred_url":"https://api.github.com/users/mackenza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mackenza/subscriptions","organizations_url":"https://api.github.com/users/mackenza/orgs","repos_url":"https://api.github.com/users/mackenza/repos","events_url":"https://api.github.com/users/mackenza/events{/privacy}","received_events_url":"https://api.github.com/users/mackenza/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-22T23:37:15Z","updated_at":"2015-07-23T13:34:53Z","closed_at":"2015-07-23T13:34:53Z","body":"I am trying to use winston to write log files (that will eventually be used by logstash to feed elasticsearch) in a batch to simulate actual historical logs. For this, I have built an object array with a deviceId and a past timestamp... something like this:\r\n\r\n```\r\n{\"deviceId\":\"5EDA32A978A4\",\"timeStmp\":\"2015-07-20T18:44:07-04:00\"},\r\n{\"deviceId\":\"5EDA32A978A4\",\"timeStmp\":\"2015-07-30T18:44:07-04:00\"},\r\n{\"deviceId\":\"A324FA33DAC2\",\"timeStmp\":\"2015-07-20T18:44:07-04:00\"},\r\n{\"deviceId\":\"A324FA33DAC2\",\"timeStmp\":\"2015-07-30T18:44:07-04:00\"},\r\n...\r\n```\r\nso you can see, it varies on deviceId and timestamp. I eventually would like to generate logs for 100,000 devices with about 1000 timestamps each... so 10m or so log entries.\r\n\r\nI am struggling with how to make this happen with iterating over the collection (object array). What I am finding is that my writes are not being done for each `logger.info()` at the end of my iteration. The writes are being queued up in memory and I see my stack get bigger and bigger. The memory never seems to get flushed and the log file is never written.\r\n\r\nI have tried using `async.forEachOfSeries()` to deal with the async nature of the stream.write but it's the same result as without using `async`.\r\n\r\nCan this level of logging be done in winston? if so, any thoughts on what I may be doing wrong? if not, do you have any suggestions on handling this high volume of event/telemetry data?\r\n\r\nthx"}}