Skip to content
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

Current log file unreadable #381

Open
pdot86 opened this issue Sep 13, 2023 · 0 comments
Open

Current log file unreadable #381

pdot86 opened this issue Sep 13, 2023 · 0 comments

Comments

@pdot86
Copy link

pdot86 commented Sep 13, 2023

I am unable to make the current log file readable- it stays in write-only mode until it is rotated out.

Example:

const logger = winston.createLogger({
  level: 'debug',
  transports: [
    new DailyRotateFile({
      dirname: '/var/log/app',
      filename: 'application-%DATE%.log',
      createSymlink: true,
      symlinkName: 'application.log',
      zipperArchive: true,
      maxSize: '20m',
      datePattern: 'YYYYMMDD',
      format((info, opts) => info.private ? false : info)
      options: { mode: 664 }
    })
  ]
})

This results in the following:

-rwxr-xr-x.     root    12345    Sep   12     22:48     application-20230912.log
--w------T.     root    34         Sep   13     14:26      application-20230913.log
lrwxrwxrwx.    root    30         Sep   13     14:26      application.log -> application-20230913.log

The issue I have is that the current log file is set to a 1200 permission the agent that reads logs is unable to read the current log file, and even though the symlink has sufficient permissions the agent is unable to read application.log either. The end result is that we are not able to collect logs until the file rotates so we are always a day behind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant