Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

How get to array element? #10

Closed
tomaszprasolek opened this issue May 29, 2020 · 2 comments
Closed

How get to array element? #10

tomaszprasolek opened this issue May 29, 2020 · 2 comments

Comments

@tomaszprasolek
Copy link

I have this json:

{
  "AllowedHosts": "*",
  "Serilog": {
    "Using": [],
    "MinimunLevel": {
      "Default": "Information",
      "Override": {
        "Microsoft": "Warning",
        "System": "Warning"
      }
    },
    "Enrich": [ "FromLogContext", "WithMachineName", "WithProcessId", "WithThreadId" ],
    "WriteTo": [
      { "Name": "Console" },
      {
        "Name": "Logger",
        "Args": {
          "configureLogger": {
            "WriteTo": [
              {
                "Name": "MSSqlServer",
                "Args": {
                  "connectionString": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=dbName;Integrated Security=True;",
                  "tableName": "Log"
                }
              }
            ],
            "Filter": [
              {
                "Name": "ByIncludingOnly",
                "Args": { "expression": "StartsWith(@Properties['SourceContext'] , 'some data') or @Exception is not null" }
              }
            ]
          }
        }
      }
    ]
  }
}

I want to replace connectionString. How to do it?

@zhangalex
Copy link

Hello Tomasz,

According to #4

I think you can take a look at WriteTo.1.Args.configureLogger.WriteTo.0.Args.connectionString: {{a conn string}}

@tomaszprasolek
Copy link
Author

Thanks, it works

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants