adams85 / filelogger

A lightweight yet feature-rich file logger implementation for the Microsoft.Extensions.Logging framework.
MIT License
147 stars 22 forks source link

BasePath directory not created when outside the current providers directory #1

Closed DoCode closed 6 years ago

DoCode commented 6 years ago

When BasePath is relative upwards the current file providers directory then the directory and logs not created.

Sample:

  "logging": {
    "BasePath": "..\\appdata\\logs",
    "EnsureBasePath": true,
    // ...
adams85 commented 6 years ago

This is the expected behavior as default implementation is built on the top of PhysicalFileProvider. This is explained in the MSDN docs: "When instantiating this provider, you must provide it with a directory path, which serves as the base path for all requests made to this provider (and which restricts access outside of this path)."

Anyway, readme docs is updated to remark on this.