Git Product home page Git Product logo

Comments (11)

iccicci avatar iccicci commented on June 30, 2024

Hi, sorry for my late reply, I have been so busy on the past months.

Are you speaking about the first time your generator is called?
If your answer is yes, my answer is: yes, it is normal, the module calls your generator with null parameters at beginning in order to know the not rotated file name .

If your generator is always called with null parameters (first time and later ones), there is some problem.

If you are still interested, can you be more precise?
Thank you

from rotating-file-stream.

iccicci avatar iccicci commented on June 30, 2024

Closing due to lack of feedback

from rotating-file-stream.

ArtixZ avatar ArtixZ commented on June 30, 2024

@iccicci I'm having the same issue.
what does this mean:

"in order to know the not rotated file name ."

from rotating-file-stream.

iccicci avatar iccicci commented on June 30, 2024

Hi @ArtixZ,

can you please share the piece of code causing the issue?

Thank you,
iCC

from rotating-file-stream.

ArtixZ avatar ArtixZ commented on June 30, 2024
function generator(time, idx) {
    return `cmnportal-${time.getFullYear()}-${time.getMonth()}_${time.getDate()}.log`
  }
const accessLogStream = rfs(generator, {
    interval: '1d', // rotate daily
    path: logDirectory
  })

I'm creating log with morgan. It will have the error when trying to run up the node server.

from rotating-file-stream.

iccicci avatar iccicci commented on June 30, 2024

Sure @ArtixZ !

Please take a look at this paragraph:
https://www.npmjs.com/package/rotating-file-stream#function-filenametime-index
Looking at your code I guess you probably could be interested to this other paragraph:
https://www.npmjs.com/package/rotating-file-stream#immutable

Please give me some feedback; closing the issue if those readings solve your problem is enough.

Thank you,
iCC

from rotating-file-stream.

iccicci avatar iccicci commented on June 30, 2024

Hi @ArtixZ ,

any news on this topic?

Thank you,
iCC

from rotating-file-stream.

ArtixZ avatar ArtixZ commented on June 30, 2024

Thanks for replying & sorry for responding late.
I've read these previously, but still wondering why the starting date is null. What if I want the the starting date when starting my server.

from rotating-file-stream.

iccicci avatar iccicci commented on June 30, 2024

Hi @ArtixZ ,

have you tried the immutable option?

Please let me know,
iCC

from rotating-file-stream.

ArtixZ avatar ArtixZ commented on June 30, 2024

Yep. Immutable is working.
Can you confirm if it works in this way without immutable:
time will be null, and I'm going to return a static file name. Once this rotation period is over, this static file will be renamed and a timestamp will be there in the name. Which means, the file will become a history.

from rotating-file-stream.

iccicci avatar iccicci commented on June 30, 2024

Hi @ArtixZ ,

I confirm, it works exactly as you described.

Thank you,
iCC

from rotating-file-stream.

Related Issues (20)

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.