log4js-node / streamroller

node.js file streams that roll over when they reach a maximum size, or a date/time.
MIT License
37 stars 19 forks source link

Tilde expansion doesn't properly support Windows #164

Closed gee4vee closed 1 year ago

gee4vee commented 1 year ago

A while back tilde expansion was added. However, on Windows this is interpreted as a literal ~ directory:

image

Example configuration:

{
  "appenders": {
    "app": { "type": "file", "filename": "~/.ibm-sb-sdk.log", "maxLogSize": "2K", "backups": 2 },
    "out": { "type": "stdout" }
  },
  "categories": {
    "default": {
      "appenders": [
        "app",
        "out"
      ],
      "level": "info"
    },
    "parse": {
      "appenders": [
        "app",
        "out"
      ],
      "level": "debug"
    },
    "metadata": {
      "appenders": [
        "app",
        "out"
      ],
      "level": "debug"
    },
    "validate": {
      "appenders": [
        "app",
        "out"
      ],
      "level": "debug"
    },
    "cache": {
      "appenders": [
        "app",
        "out"
      ],
      "level": "debug"
    },
    "cli": {
      "appenders": [
        "app",
        "out"
      ],
      "level": "info"
    }
  }
}
lamweili commented 1 year ago

Released in streamroller@3.1.5.

lamweili commented 1 year ago

Hi @gee4vee, did it resolve the issue?