mattwcole / gelf-extensions-logging

GELF provider for Microsoft.Extensions.Logging
MIT License
109 stars 42 forks source link

Add additional function fields into option and send evaluated values as the additional fields #53

Closed hercegyu closed 4 years ago

hercegyu commented 4 years ago

This is code for enabling new additional function fields that can be used for new calculable values for additional fields. It's related to the colleague's issue/request #52

Really minimal adjustment in GelfLogger.cs.

Usage is simple, shown in updated README.md

Also, the code includes 2 new tests, covering this new feature.

nikolic-bojan commented 4 years ago

Hi @hercegyu , Could you check here similar implementation? https://github.com/mattwcole/gelf-extensions-logging/compare/dev...nikolic-bojan:dev

Thanks!

hercegyu commented 4 years ago

@nikolic-bojan and @mattwcole Could you please do some code review.

Thanks.

nikolic-bojan commented 4 years ago

@hercegyu I would suggest removing OriginalData class and the property from GelfMessage. It is not needed as all properties are already available in the GelfLogger Log method and AdditionalFieldsFactory states all 3 of them in Func<>.

So, GelfLogger method GetComputedAdditionalFieldsFromAdditionalFieldsFactory could accept those 3 parameters and eliminate this additional OriginalData class.

mattwcole commented 4 years ago

Looks good, I'll get a preview package released shortly. Many thanks!