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

Code snippet contains ghost variable in readme.md #408

Closed
mperudirectio opened this issue Jul 22, 2022 · 1 comment
Closed

Code snippet contains ghost variable in readme.md #408

mperudirectio opened this issue Jul 22, 2022 · 1 comment

Comments

@mperudirectio
Copy link

mperudirectio commented Jul 22, 2022

In this code snippet provided into the principal readme.md:

var logDB = @"Server=...";
var sinkOpts = new MSSqlServerSinkOptions();
sinkOpts.TableName = "Logs";
var columnOpts = new ColumnOptions();
columnOpts.Store.Remove(StandardColumn.Properties);
columnOpts.Store.Add(StandardColumn.LogEvent);
columnOpts.LogEvent.DataLength = 2048;
columnOpts.PrimaryKey = options.TimeStamp;
columnOpts.TimeStamp.NonClusteredIndex = true;

var log = new LoggerConfiguration()
    .WriteTo.MSSqlServer(
        connectionString: logDB,
        sinkOptions: sinkOpts,
        columnOptions: columnOpts
    ).CreateLogger();

the object options, from which options.TimeStamp is derived, it's of unknown type and there is no instance of it in the code snippet.

Can I just know what it's related to?
Thank you

UPDATE
Calling the variable columnOpts instead of options solved the problem.
It is probably just an error due to the wrong name of the variable

ckadluba added a commit to ckadluba/serilog-sinks-mssqlserver that referenced this issue Jul 24, 2022
Wrong variable name in code sample corrected.
@ckadluba
Copy link
Member

Hi @mperudirectio!

Thank you for pointing this out. I fixed it in PR #409.

Cheers,
Christian!

ckadluba added a commit that referenced this issue Jul 24, 2022
Wrong variable name in code sample corrected.
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