serilog-sinks-http icon indicating copy to clipboard operation
serilog-sinks-http copied to clipboard

Add ability to select the extension of log files on durability

Open RuslanLatsina opened this issue 3 years ago • 6 comments

There is an issue with supporting compatibility between different sinks. As an example Elastic.sink has json extension, but HTTP.sink - txt

It will be nice to have the ability to override the extension

RuslanLatsina avatar Sep 19 '22 13:09 RuslanLatsina

Hi there and welcome to this repository!

A maintainer will be with you shortly, but first and foremost I would like to thank you for taking the time to report this issue. Quality is of the highest priority for us, and we would never release anything with known defects. We aim to do our best but unfortunately you are here because you encountered something we didn't expect. Lets see if we can figure out what went wrong and provide a remedy for it.

github-actions[bot] avatar Sep 19 '22 13:09 github-actions[bot]

Hi @RuslanLatsina. Can you elaborate a bit more on why you find it problematic that different sinks create files with different file endings?

FantasticFiasco avatar Sep 19 '22 14:09 FantasticFiasco

Hi @FantasticFiasco , I'm trying to inject http.Sink with elastic.sink into project but found that when I'm trying switch destination, bookmark file is not trying to be updated by itself. And here i got an issue when bookmark file contains invalid last-file extension, the transfering is not continued.

RuslanLatsina avatar Sep 19 '22 14:09 RuslanLatsina

So you are sending log events to Elasticsearch using Serilog.Sinks.Elasticsearch and you use this sink to send the same log events to another log server. Is this correct?

...bookmark file is not trying to be updated by itself

I don't know what you mean here. Can you explain a bit more?

...bookmark file contains invalid last-file extension,

What is a "last-file extension"?

For reference, the reason why we use txt files is described in #169.

FantasticFiasco avatar Sep 20 '22 05:09 FantasticFiasco

Hi @FantasticFiasco , yeah, you are right. My c# desktop application gets the destination log server from API. And if we change the destination from ElasticSearch to another LogServer, which sends logs through API, the logs are not sent anymore.

I observed that on LogProvider change, the log files started to have another file extension. And if Bookmark file contains an invalid extension, the logs are not sent to another LogServer. But if I clean bookmark file content and remove all files with ".json" extension - the logs are sent successfully again. image

RuslanLatsina avatar Sep 20 '22 12:09 RuslanLatsina

Is the bookmark file and the buffer files shared between Serilog.Sinks.Elasticsearch and this sink? I.e. are both sinks relying on the same set of files, or do they have their individual set of files?

FantasticFiasco avatar Sep 21 '22 05:09 FantasticFiasco

Close due to inactivity.

FantasticFiasco avatar Jan 02 '23 20:01 FantasticFiasco