-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permission of log files (linux) #184
Comments
I've submitted a PR at rogerc/file-stream-rotator#46 to incorporate this functionality. If it is accepted, I'll publish an updated version of the transport with the requested functionality. |
Added in 9770c46 and published to npm as |
Thanks a lot for the quick fix! Can you update index.d.ts as well :) |
Added in b71d68a. Sorry, but I dont use ts and am not familiar with how these defs work. Not sure if there's anything more that needs to happen, or if ts just uses the github repo. |
I believe this is good now. Thanks again! |
One more thing, can you release the new version to npm? :) |
Published as |
Hi Matt, I am using the "winston-daily-rotate-file": "3.9.0" version and encountered problem related to this issue. Problem Statement: var transport = new (transports.DailyRotateFile)({ But the permissions of logfile did not change on both windows and Linux. Thanks |
What am I missing? The following code seems to work as expected. Do you have permission issues elsewhere on the filesystem? var transport = new (winston.transports.DailyRotateFile)({
filename: './logs/application-%DATE%',
options: { flags: 'a', mode: 0o755 }
});
var logger = winston.createLogger({
transports: [
transport
]
});
logger.info("Hello world!"); Folder listing
|
Case 1 logs# ls -ltr Case 2 logs# ls -ltr Case 3 logs# ls -ltr Case 4 logs# ls -ltr In any case, I did not get the write permissions for other users. Even in windows, I did not get write permissions for others users. Please let me know if this is expected behaviour or it is bug or am I missing something Thanks |
And What about auditFile ? How to change the auditFile permissions? |
@parthgoyal If the mode is not set properly on a new file being created, there must be a misconfiguration in your node or system environment. The transport just passes the options hash through to var fs = require('fs');
var stream = fs.createWriteStream('hello.txt', { mode: 0o777 });
stream.write('test');
stream.end(); At this time it is not possible to change auditFile permissions. |
Can we have something like this: winstonjs/winston#688
Would like to give group permission for the log files when created.
The text was updated successfully, but these errors were encountered: