📌  相关文章
📜  Serilog.Settings.Configuration - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:52.144000             🧑  作者: Mango

代码示例1
static void Main(string[] args)
{
    var configuration = new ConfigurationBuilder()
        .SetBasePath(Directory.GetCurrentDirectory())
        .AddJsonFile("appsettings.json")
        .Build();

    var logger = new LoggerConfiguration()
        .ReadFrom.Configuration(configuration)
        .CreateLogger();

    logger.Information("Hello, world!");
}