{"action":"closed","issue":{"url":"https://api.github.com/repos/mentum/lawgs/issues/3","labels_url":"https://api.github.com/repos/mentum/lawgs/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/mentum/lawgs/issues/3/comments","events_url":"https://api.github.com/repos/mentum/lawgs/issues/3/events","html_url":"https://github.com/mentum/lawgs/issues/3","id":115560147,"number":3,"title":"Using lawgs in a lamda function","user":{"login":"foobar8675","id":1685700,"avatar_url":"https://avatars.githubusercontent.com/u/1685700?v=3","gravatar_id":"","url":"https://api.github.com/users/foobar8675","html_url":"https://github.com/foobar8675","followers_url":"https://api.github.com/users/foobar8675/followers","following_url":"https://api.github.com/users/foobar8675/following{/other_user}","gists_url":"https://api.github.com/users/foobar8675/gists{/gist_id}","starred_url":"https://api.github.com/users/foobar8675/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foobar8675/subscriptions","organizations_url":"https://api.github.com/users/foobar8675/orgs","repos_url":"https://api.github.com/users/foobar8675/repos","events_url":"https://api.github.com/users/foobar8675/events{/privacy}","received_events_url":"https://api.github.com/users/foobar8675/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-06T18:23:11Z","updated_at":"2015-11-06T21:42:53Z","closed_at":"2015-11-06T21:42:53Z","body":"Lawgs is awesome. It really simplifies writing to cloudwatch. I have a question I was hoping to get your 2 cents on. I have a lamda function which receives logging requests from mobile clients. The only way I could get the event to write out is by putting a timer before context.succeed() Do you know a cleaner way to approach this?\r\n \r\n````\r\nvar lawgs = require('lawgs');\r\nvar logger  = lawgs.getOrCreate('/betatest/ios/logs/ble');\r\nlogger.config({\r\n\t// Shows the debugging messages\r\n\tshowDebugLogs: true, /* Default to false */\r\n\t// Change the frequency of log upload, regardless of the batch size\r\n\tuploadMaxTimer: 0, /* Defaults to 5000ms */\r\n\t// Max batch size. An upload will be triggered if this limit is reached within the max upload time\r\n\tuploadBatchSize: 1 /* Defaults to 500 */\r\n});\r\n\r\nexports.handler = function(event, context) {\r\n\tlogger.log('events', event);\r\n\tsetTimeout(function() {\r\n\t\tcontext.succeed(\"cool beans 1\");\r\n\t}, 2000);\r\n};\r\n````\r\n"}}