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

Enable CloudWatch Sink through configuration file #28

Closed
SubmittaBrian opened this issue Feb 21, 2017 · 2 comments
Closed

Enable CloudWatch Sink through configuration file #28

SubmittaBrian opened this issue Feb 21, 2017 · 2 comments

Comments

@SubmittaBrian
Copy link

I'd love to be able to drop in this sink by adding it to app.config, but I don't think Serilog currently supports nested deserialization (or I haven't been able to make it work).

Would you consider adding an overload to AwsCloudWatchConfigurationExtension.AmazonCloudWatch that takes options and credentials as top-level parameters?

This would allow me to extend my prod app.config file like:

<appSettings>
    <!-- Log everything to Stackify for historical debug by DevOps-->
    <add key="serilog:using:Stackify" value="Serilog.Sinks.Stackify" />
    <add key="serilog:write-to:Stackify" />
    <add key="serilog:write-to:Stackify.restrictedToMinimumLevel" value="Debug" />

    <!-- Log Fatal errors to CloudWatch for real-time alert distribution e.g. pager duty systems -->
    <add key="serilog:using:AmazonCloudWatch" value="Serilog.Sinks.AwsCloudWatch" />
    <add key="serilog:write-to:AmazonCloudWatch"/>
    <add key="serilog:write-to:AmazonCloudWatch.logGroupName" value="myLogGroup/myEnvironment"/>
    <add key="serilog:write-to:AmazonCloudWatch.minimumLogEventLevel" value="Fatal"/>
    <add key="serilog:write-to:AmazonCloudWatch.awsRegion" value="us-west-1"/>
    <add key="serilog:write-to:AmazonCloudWatch.awsAccessKey" value="*****"/>
    <add key="serilog:write-to:AmazonCloudWatch.awsSecretKey" value="*****"/>
</appSettings>
@wparad
Copy link
Collaborator

wparad commented Feb 22, 2017

Sounds like a good idea, feel free to make a PR.

@wparad
Copy link
Collaborator

wparad commented Feb 22, 2017

For the record, I think the problem that the constructor requires parameters, we probably just need an empty constructor, and then we'll be good.

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

No branches or pull requests

2 participants