This week's book giveaway is in the Programmer Certification forum. We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
We have a requirement to split the large log message (Lets say a xml having lot of data) and logging only at max 4 mb of data at a time.
So if the log is of 6 mb split it into two and log first 4 mb in one log statement and remaining 2 mb in second log statement.
Can anybody please guide me on how to do this?
Why do you want to split the log? Are the log files already generated? You must be knowing that you can limit the size of the log file to the size you want and log4j would automatically take care of the size constraint for you.
If you want to split the logs already generated, I do not think log4j would be of much help on that.
posted 8 years ago
Thanks a lot Raj for your time.
Yes, the requirement is to split the log and not the log files.
It is to take care that if someone logs a log of more then say 4MB (Lets say a message received from a MQ, a large XML etc) we should split the log itself.