serilog-archive / serilog-sinks-loggly

A Serilog event sink that writes to Loggly
Apache License 2.0
27 stars 30 forks source link

LogglyClient configuration and auto added log fields #29

Closed thviQit closed 6 years ago

thviQit commented 6 years ago

In order to configure the underlying LogglyClient when you don't have the possibility to (or just don't want to) use xml configuration, I've opened up the sink to use a configuration object if it is provided. If no object is provided, the current way of reading up the configuration is used.

Furthermore, I wanted to have the control over if I wanted to have the fields "Level", "Message", and "Exception" automatically added to log messages if not already present in the list of Serilog properties. So again opening up for passing in an object to do that. The change still defaults to how it is now, if no object is provided.

thviQit commented 6 years ago

I suppose that is up to you. If you want to have it, I'll pump up the versions. I've tried to use default parameters, so other users shouldn't be affected if they update, as long as they use the extension method. I see your concern if somebody is using the constructor directly, e.g. wrapping it in another sink. I'll write a chain with "this". Do you still want the updated versions?

MiguelAlho commented 6 years ago

I'd recommend just one change - in the .csproj, update and use the element and remove the and element. The build will define the package version based on the branch (if version prefix is 5.2.0, then the package will be 5.2.0-alphaX in the dev branch, and 5.2.0 once merged into master).

thviQit commented 6 years ago

Hadn't seen that one. Updated

MiguelAlho commented 6 years ago

I've removed the FileVersion and Version elements from the csproj to prevent locking the version number and accelerate the approval process.