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

Simplify DbMigrator console output #3658

Closed
olicooper opened this issue Apr 18, 2020 · 1 comment · Fixed by #3676
Closed

Simplify DbMigrator console output #3658

olicooper opened this issue Apr 18, 2020 · 1 comment · Fixed by #3676

Comments

@olicooper
Copy link
Contributor

Just a small suggestion... Because Serilog is already outputting to the console for the DbMigrator, there is no need for the default ILogger to be registered and outputting unnecessary information on the console. We can disable like below:

using Microsoft.Extensions.Hosting;

public static IHostBuilder CreateHostBuilder(string[] args) =>
    Host.CreateDefaultBuilder(args)
        .ConfigureLogging((context, logging) => logging.ClearProviders()) //ADD THIS
        .ConfigureServices((hostContext, services) =>
        {
            services.AddHostedService<DbMigratorHostedService>();
        });

Before:
image

After:
image

I would probably make it read "Migration successful. Press Ctrl+C to exit." at the end.

@olicooper olicooper changed the title Simplify console output Simplify DbMigrator console output Apr 18, 2020
@maliming
Copy link
Member

I would probably make it read "Migration successful. Press Ctrl+C to exit." at the end.

The migration application will automatically terminate.

https://github.com/abpframework/abp/blob/dev/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/DbMigratorHostedService.cs#L37

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

Successfully merging a pull request may close this issue.

2 participants