-
Notifications
You must be signed in to change notification settings - Fork 54
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
Error: Method not found: 'Void Serilog.Formatting.Json.JsonFormatter..ctor #131
Comments
So that's weird, there's no way for this library to get past the build stage without this working. If you add in an explicit package reference to Serilog, rerun <ItemGroup>
...
<PackageReference Include="Serilog" Version="[2.5.0,)" />
...
</ItemGroup |
Thank you @wparad I tried that but still the same error. This is how my csproj file look like
|
What happens when you explicitly use the other constructor and explicitly pass in the public static LoggerConfiguration AmazonCloudWatch(
this LoggerSinkConfiguration loggerConfiguration,
string logGroup,
ILogStreamNameProvider logStreamNameProvider,
LogEventLevel restrictedToMinimumLevel = LogEventLevel.Verbose,
int batchSizeLimit = 100,
int batchUploadPeriodInSeconds = 10,
bool createLogGroup = true,
int queueSizeLimit = 10000,
byte maxRetryAttempts = 5,
LogGroupRetentionPolicy logGroupRetentionPolicy = LogGroupRetentionPolicy.OneWeek,
ITextFormatter textFormatter = null,
IAmazonCloudWatchLogs cloudWatchClient = null) as |
Thank you @wparad , Still the same issue. I just tried to work with bar minimum code and packages but no luck.
|
This will be fixed in #132, you can, easily get around this by using the preferred var formatter = new JsonFormatter();
// options for the sink defaults in https://github.com/Cimpress-MCP/serilog-sinks-awscloudwatch/blob/master/src/Serilog.Sinks.AwsCloudWatch/CloudWatchSinkOptions.cs
var options = new CloudWatchSinkOptions
{
// the name of the CloudWatch Log group for logging
LogGroupName = logGroupName,
// the main formatter of the log event
TextFormatter = formatter,
// other defaults defaults
MinimumLogEventLevel = Serilog.Events.LogEventLevel.Debug,
BatchSizeLimit = 100,
QueueSizeLimit = 10000,
Period = TimeSpan.FromSeconds(10),
CreateLogGroup = true,
LogStreamNameProvider = new DefaultLogStreamProvider(),
RetryAttempts = 5
}; and then: Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.AmazonCloudWatch(options, client)
.CreateLogger(); |
Thank you so much @wparad |
In our case we configure everything in appsettings. Could someone please review the PR? |
Issue:
After update cloudwatch sink to v4.2.17/19 I started getting this error when running the app however it works fine in v4.1.15.
Issue introduced in version:
4.2.17
Full error content
To reproduce:
Create empty Asp.Net Project
![image](https://private-user-images.githubusercontent.com/9500241/316500639-d30bba61-40e3-403e-85d2-7c144a099760.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NDQ4NDMsIm5iZiI6MTczODk0NDU0MywicGF0aCI6Ii85NTAwMjQxLzMxNjUwMDYzOS1kMzBiYmE2MS00MGUzLTQwM2UtODVkMi03YzE0NGEwOTk3NjAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMTYwOTAzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjZlNjc3NTM0ZjVjNGQ3ZDZlYzEzMTA0ZDQ3MzdlMTA5MGZiOWMzZTZiODAxMzhkZTkyYTk4ZDkzZTIwNzJhNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.q-gGQ3rLDau197l_T9uqpjasJow1i-gCz5k26FXvagc)
Add code below:
What I did so far,
Thank you,
The text was updated successfully, but these errors were encountered: