Open Closed

Log for Console App not working #10660

andmattia created

Abp 4.8.1

Hi I've a console application that works on ABP + HangFire.

on Program.cs I've

 var host = Host.CreateDefaultBuilder(args);
                (hostContext, config) =>
                    config.AddJsonFile("appsettings.json", false, true);

                loggingBuilder =>

                    var configuration = new ConfigurationBuilder()
                        .AddJsonFile("appsettings.json", false, true)
                    var loggerConfig = new LoggerConfiguration()

                    var logger = loggerConfig.CreateLogger();
                    loggingBuilder.AddSerilog(logger, dispose: true);

So I see that HangFire logs work beacuse HF internlly search the logger provider how can I tell to ABP to use my log model?

1 Answer(s)
  • 0
    andmattia created

    I found a solution

    Move on start program Log stiatic definition and use generic logFactory to inject on Abp