NLog.Appsetting.Standard 1.0.2

The package is no longer updated and maintained. It is recommended to replace this to NLog.Appsettings.Standard.

The owner has unlisted this package. This could mean that the package is deprecated or shouldn't be used anymore.
Install-Package NLog.Appsetting.Standard -Version 1.0.2
dotnet add package NLog.Appsetting.Standard --version 1.0.2
<PackageReference Include="NLog.Appsetting.Standard" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NLog.Appsetting.Standard --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

The package is no longer updated and maintained. It is recommended to replace this to NLog.Appsettings.Standard.

How To Use

Install the NLog.Appsetting.Standard package from NuGet. You need add NLog 4.5 or higher, then put the syntax in your NLog configuration below:

<nlog>
    <extensions>
        <add assembly="NLog.Appsetting.Standard" />
    </extensions>
</nlog>

Appsetting layout renderer configuration

The layout renderer's name is appsetting.

Configuration Syntax & Parameters

${appsetting:name=String.String2.String3:default=String}

  • name - Key in your appsettings.<EnvironmentName>.json file. If it has a multi-level hierarchy that you want to access, you can separate by a dot. Required.
  • default - Default value if not present. Optional.
Example:

Target appsettings.json

{
    "Mode":"Prod",
    "Options":{
        "StorageConnectionString":"abcdefg123456789",
        "Container":"YourProdContainer"
    }
}
  • ${appsetting:name=Mode} - Get "Prod" in this case.
  • ${appsetting:name=Options.StorageConnectionString} - Get "abcdefg123456789" in this case.
  • ${appsetting:name=Options.StorageConnectionString2:default=DefaultString} - Get "DefaultString" in this case.

Note

If you need other NLog extensions(Target or Layout Renderer) that built by me or prefer all in one like me. You can refer this and its document!!!

The package is no longer updated and maintained. It is recommended to replace this to NLog.Appsettings.Standard.

How To Use

Install the NLog.Appsetting.Standard package from NuGet. You need add NLog 4.5 or higher, then put the syntax in your NLog configuration below:

<nlog>
    <extensions>
        <add assembly="NLog.Appsetting.Standard" />
    </extensions>
</nlog>

Appsetting layout renderer configuration

The layout renderer's name is appsetting.

Configuration Syntax & Parameters

${appsetting:name=String.String2.String3:default=String}

  • name - Key in your appsettings.<EnvironmentName>.json file. If it has a multi-level hierarchy that you want to access, you can separate by a dot. Required.
  • default - Default value if not present. Optional.
Example:

Target appsettings.json

{
    "Mode":"Prod",
    "Options":{
        "StorageConnectionString":"abcdefg123456789",
        "Container":"YourProdContainer"
    }
}
  • ${appsetting:name=Mode} - Get "Prod" in this case.
  • ${appsetting:name=Options.StorageConnectionString} - Get "abcdefg123456789" in this case.
  • ${appsetting:name=Options.StorageConnectionString2:default=DefaultString} - Get "DefaultString" in this case.

Note

If you need other NLog extensions(Target or Layout Renderer) that built by me or prefer all in one like me. You can refer this and its document!!!

Release Notes

The package is no longer updated and maintained. It is recommended to replace this to NLog.Appsettings.Standard.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated