CsvRequestLogger does not work on IIS

When debugging in Visual Studio

        Plugins.Add(new RequestLogsFeature
        {
            RequestLogger = new CsvRequestLogger(),
        });

This does create the directory requestlogs and does save the log files.

When published to IIS, neither the directory nor the files are created. Where could be the problem, please?

IIS should have write access to directory where logs are created. By default it restricts write operations to web directory for security reasons. You should create requestlogs directory in IIS and allow to write to requestlogs directory for user under which ASP.NET is running.