Comments (11)
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.
Closing due to lack of feedback
from rotating-file-stream.
@iccicci I'm having the same issue.
what does this mean:
"in order to know the not rotated file name ."
from rotating-file-stream.
Hi @ArtixZ,
can you please share the piece of code causing the issue?
Thank you,
iCC
from rotating-file-stream.
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.
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.
Hi @ArtixZ ,
any news on this topic?
Thank you,
iCC
from rotating-file-stream.
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.
Hi @ArtixZ ,
have you tried the immutable option?
Please let me know,
iCC
from rotating-file-stream.
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.
Hi @ArtixZ ,
I confirm, it works exactly as you described.
Thank you,
iCC
from rotating-file-stream.
Related Issues (20)
- Compressed rotated files don't have the `.gz` suffix HOT 3
- cannot find module "fs/promises" with nodejs 12.22.7 HOT 7
- no such file or directory, rename log failed HOT 4
- While rotating log file gives EPERM: operation not permitted, stat error HOT 7
- how to create symlink HOT 3
- Cannot find module 'fs/promises' HOT 6
- Not able to compress log file HOT 3
- [bug] Cannot read properties of undefined (reading 'write') HOT 25
- Rotating log file with size, maxFiles and path options HOT 9
- Unhandled Error, No such file or directory, unlink called twice on same file. HOT 17
- The first rotated file is not specified time length. HOT 1
- Error: this.timeout.unref is not a function HOT 10
- while deploying the project i am getting this error please help HOT 7
- [bug] it does not create the file again when it's writing HOT 1
- Custom compressed file names HOT 4
- how do i do the unit testing in node js HOT 2
- Sometimes crashes on interval change HOT 3
- UTC: interval & intervalBoundary HOT 1
- Jumping from Node v14 to v18 between 3.1.1 and 3.2.0 HOT 6
- maxfiles seems to cause an error: Error: ENOENT: no such file or directory HOT 3
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 rotating-file-stream.