Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New logFileHeaders parameter added to configuration method #95

Closed
wants to merge 1 commit into from

Conversation

kamilozturk
Copy link

We want to create a w3c formed special log files. It requires a special #Fields directive before log lines.
If we can do this, we can review our log files via Log Parser Studio tool. So we have created a new logFileHeaders parameter and we have inserted to configuration method to able append header text to the log file after a new log file generated.

…header text to the log file after a new log file generated
@nblumhardt
Copy link
Member

Hi! I think @cocowalla's #80 will cover this case (write a hook that emits the headers if the new file stream being wrapped is zero-length). It would be great to have your thoughts on this approach. Cheers!

@cocowalla cocowalla mentioned this pull request Apr 15, 2019
@nblumhardt
Copy link
Member

Closing as I think we'll initially cover this via #80; thanks again for sending this, hopefully this use case will be covered soon 👍

@nblumhardt nblumhardt closed this Apr 20, 2019
@nblumhardt
Copy link
Member

Quick note, the latest -dev package on NuGet now supports this, though you need to write the hook yourself; there's an example in:

https://github.com/serilog/serilog-sinks-file/blob/dev/test/Serilog.Sinks.File.Tests/FileSinkTests.cs#L187

@cocowalla
Copy link
Contributor

@kamilozturk @nblumhardt I've just published a NuGet package, Serilog.Sinks.File.Header, which contains a header-writing implementation - just let me know if you encounter any issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants