Dear All,
Kindly let me know in the above code why it’s not writing a log only for 2 MB, (This is my requirement).
My Business Requirement :- Generate a log file every day only one file and keep only 2 MB in size, if the logs are more in size than truncate the old data for the same day.
For My requirement I think below lines of codes are correct, But it’s not working as per my expectation, instead its creating log file which is more in size i.e. 5 MB,6 MB etc..

Kumar AURank #3,821 · 387 reputationPosted Feb 1, 2017, 4:43 AM EST
Thanks Bikesh for your response.
Bikesh SrivastavaRank #108 · 20.3K reputationPosted Feb 1, 2017, 3:57 AM EST