Ideally good not to hard code the MaximumBytesAllowedToLoggly. It will be good to have the size variable and can be passed as config. For now I am approving this. @Shwetajain148 please log JIRA to make the value define in config.
@mchaudhary, Actually I hard coded value of MaximumBytesAllowedToLoggly because we can send 1 MB per event i.e. maximum 1048576 bytes and in different encoding techniques like utf-8, utf-16 etc, individual character can take 1 to 6 bytes of memory space that increases the log message size each time. Due to this reason I took a safe side value less than actually accepted value so that if log message size increases due to different encoding techniques our final log message size would be less than 1 MB after truncation and will also reach to loggly successfully. I have also tested with different payload size and this logic was successfully truncating log message greater than 1 MB and logs were also reaching to loggly of less than 1 MB event size.
In that case we can not make MaximumBytesAllowedToLoggly configurable/dynamic. Anyways this logic is only applicable for truncating log message greater than 1 MB and not affecting any other code in library.
I have updated code to set value of MaximumBytesAllowedToLoggly using a constant variable.
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.
We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products.
Learn more.
We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products.
You can always update your selection by clicking Cookie Preferences at the bottom of the page.
For more information, see our Privacy Statement.
Essential cookies
We use essential cookies to perform essential website functions, e.g. they're used to log you in.
Learn more
Always active
Analytics cookies
We use analytics cookies to understand how you use our websites so we can make them better, e.g. they're used to gather information about the pages you visit and how many clicks you need to accomplish a task.
Learn more
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LB-872 Improve Node with retry logic and queue #5
LB-872 Improve Node with retry logic and queue #5
Changes from 1 commit
fdba23a584da85da058a3File filter...
Jump to…
Make buffer option configurable and truncate events size over 1 MB
mchaudharyJan 10, 2017
Ideally good not to hard code the MaximumBytesAllowedToLoggly. It will be good to have the size variable and can be passed as config. For now I am approving this. @Shwetajain148 please log JIRA to make the value define in config.
Shwetajain148Jan 11, 2017
Author
@mchaudhary, Actually I hard coded value of
MaximumBytesAllowedToLogglybecause we can send 1 MB per event i.e. maximum1048576 bytesand in different encoding techniques likeutf-8, utf-16etc, individual character can take1 to 6 bytesof memory space that increases the log message size each time. Due to this reason I took a safe side value less than actually accepted value so that if log message size increases due to different encoding techniques our final log message size would be less than 1 MB after truncation and will also reach to loggly successfully. I have also tested with different payload size and this logic was successfully truncating log message greater than 1 MB and logs were also reaching to loggly of less than 1 MB event size.In that case we can not make
MaximumBytesAllowedToLogglyconfigurable/dynamic. Anyways this logic is only applicable for truncating log message greater than 1 MB and not affecting any other code in library.I have updated code to set value of
MaximumBytesAllowedToLogglyusing a constant variable.Shwetajain148Jan 12, 2017
Author
@mchaudhary Please have a look at my comment above. Thanks