Skip to content

Current log file unreadable #381

Open
@pdot86

Description

@pdot86

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions