Giter Club home page Giter Club logo

Comments (8)

vy avatar vy commented on June 2, 2024

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.

vy avatar vy commented on June 2, 2024

@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.

shibaevv avatar shibaevv commented on June 2, 2024

from hrrs.

shibaevv avatar shibaevv commented on June 2, 2024

I think this simple solution will work..
Base64HrrsFilter.java.zip

from hrrs.

vy avatar vy commented on June 2, 2024

Thanks for sharing your solution @shibaevv, but it has two major drawbacks:

  1. Filter should not deal with file rotation. It is a responsibility of Writer and WriterTarget classes. (For instance, in Log4j, do you specify/trigger rotation every time you call log.info(...)?)
  2. Calling File#length() for every record is [IMHO] unacceptable from performance PoV.

from hrrs.

shibaevv avatar shibaevv commented on June 2, 2024

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.

vy avatar vy commented on June 2, 2024

@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.

vy avatar vy commented on June 2, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.