serilog / serilog-sinks-file

Write Serilog events to files in text and JSON formats, optionally rolling on time or size
Apache License 2.0
333 stars 117 forks source link

RollingFileSink Class Access Modifier #286

Closed gravity-tthrockmorton closed 1 year ago

gravity-tthrockmorton commented 1 year ago

The RollingFileSinkaccess modifier is not provided so it's defaulting to private. Since this is the port from Serilog.Sink.RollingFile, should this be set as public sealed instead of private sealed so that it can be declared and used?

nblumhardt commented 1 year ago

Hi @gravity-tthrockmorton; no, this is intentional, the class isn't intended to be part of the package's public API.

gravity-tthrockmorton commented 1 year ago

@nblumhardt We're looking into Loggly and may potentially take over the maintenance of https://github.com/serilog-archive/serilog-sinks-loggly. When I was forking it and testing it, I noticed that it used RollingFileSink for creating Durable persistence in case the connection is lost. To support this, would it just be as simple as changing it from the RollingFileSink to FileSink and making the buffered parameter true?

nblumhardt commented 1 year ago

Hi Tyler; you may be able to get the same functionality out of Serilog.Sinks.File - you might need some tweaks around file naming, depending on how the existing code works.

Checking out the durable mode of Serilog.Sinks.Seq (which uses the newer File sink) might offer some clues, I think the code is fairly similar. HTH!