Skip to content

File appenders try to open files even though they do not exist in a category #1000

@thernstig

Description

@thernstig

I have a setup where I've configured a file appender on a logging config object, but I never added that file appender to any category.

When log4js loads the config, it then prints:

log4js.fileAppender - Writing to file /path/to/server.log, error happened  [Error: EACCES: permission denied, open '/path/to/server.log'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/var/opt/ericsson/cnom/log/eric-cnom-server.log'
}

Is this intentional? Or could the appenders avoid trying to open the file until they have actually been added to a category?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions