Comments (8)
Hey @shibaevv! That was indeed the reason I kept *Writer
and *WriterTarget
classes separate. Let me see if I can spare some time to work on this.
from hrrs.
@shibaevv, if you take a quick look at the contents of the org.apache.logging.log4j.core.appender.rolling
package, you will notice how complicated file rotation might get. You need a rotation trigger and strategy with all the bells and whistles. You can't just blindly check prevFileName.equals(fileNamePattern.apply(System.currentTimeMillis()))
and commence a rotation. I welcome any well-engineered patches (not just a fix to save the day), but I am really short of time to implement such a relatively big feature myself. I had mentioned about logrotate
in README. Didn't it work for you?
from hrrs.
from hrrs.
I think this simple solution will work..
Base64HrrsFilter.java.zip
from hrrs.
Thanks for sharing your solution @shibaevv, but it has two major drawbacks:
Filter
should not deal with file rotation. It is a responsibility ofWriter
andWriterTarget
classes. (For instance, in Log4j, do you specify/trigger rotation every time you calllog.info(...)
?)- Calling
File#length()
for every record is [IMHO] unacceptable from performance PoV.
from hrrs.
It was quick temp solution to fix my problem.
I notice you have @see com.vlkan.hrrs.servlet.HrrsFilter#getMaxRecordablePayloadByteCount(), so you can integrate this rolling functionality on overflow event:
if (recordedLenght > getMaxRecordablePayloadByteCount())
from hrrs.
@shibaevv, I have just released a new library: rotating-fos. I will be using this to enhance HttpRequestRecordWriterFileTarget
. If you want to give it a try yourself first, go ahead.
from hrrs.
@shibaevv, I have pushed the change and I am about to cut a new release. Please do let me know if it doesn't work for you. (Feel free to re-open the issue.)
from hrrs.
Related Issues (14)
- Typo in README, and a suggestion for phrashing HOT 1
- ApacheHttpRequestRecordReplayer is using "Content-length" header twice HOT 1
- Too heavy synchronization in Base64HttpRequestRecordWriter HOT 1
- Caused by: org.apache.http.ProtocolException: Content-Length header already present HOT 1
- Controller not mapping HOT 3
- Implement flush() BufferedWriter in HttpRequestRecordWriterFileTarget HOT 2
- httpclient-redirect-when-using-post-method HOT 2
- HRRS filter does not save request Form Data HOT 4
- 5y
- No implementation for HttpRequestRecordWriter<?> was bound HOT 3
- the question of HrrsUrlEncodedFormHelper.java code HOT 3
- Migrate to Java 8
- Replace Travis CI with GitHub Actions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hrrs.