BedeGaming / sinks-rollingfile

A serilog sink for rolling files based on size and time
Apache License 2.0
15 stars 20 forks source link

Overloaded RollingFileAlternate with a prefix for log file name. #33

Closed pradeepneo closed 7 years ago

pradeepneo commented 7 years ago

Added a overloaded extension method RollingFileAlternate to pass a prefix for log file names. The prefix is passed along to the AlternateRollingFileSink which will be used while creating the name for log file. If the prefix parameter is not passed to RollingFileAlternate, it will create the file names as earlier and the original behavior is not modified. In case, if we need to have specific loggers configured to have specific events, this will be useful as it lets to specify prefix for log files, there by making them distinguishable from each other.

vadimkhm commented 7 years ago

Nice, Thanks!

dhjon commented 7 years ago

Much needed feature, thank you!

vadimkhm commented 7 years ago

Sorry do you plan merge this to master? I cannot get this functionality in version 2.0.7. Thanks, Vadim

pradeepneo commented 7 years ago

@vadimkhm I am waiting for the pull request to be reviewed and merged by @AndyWardle. I guess it might make it to a later version.

vadimkhm commented 7 years ago

@pradeepneo, @AndyWardle Ok thanks a lot!

vadimkhm commented 7 years ago

guys any news for merging this?

rpiesnikowski commented 7 years ago

What about this pull request ? @AndyWardle could you look and approve if code is good?

AndyWardle commented 7 years ago

This is now in version 2.0.8 onwards

vadimkhm commented 7 years ago

Thanks!

cocowalla commented 7 years ago

@AndyWardle & @pradeepneo, there's a bit of a problem with Serilog.Sinks.RollingFileAlternate.LoggerConfigurationExtensions - you can't set a log prefix and specify an ITextFormatter at the same time. I just opened issue #39 for this.