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

No log error in new code #1020

Open
nqtuyen opened this issue Jan 14, 2022 · 1 comment
Open

No log error in new code #1020

nqtuyen opened this issue Jan 14, 2022 · 1 comment

Comments

@nqtuyen
Copy link

nqtuyen commented Jan 14, 2022

Old code use Serilog and can log error to txt file. But It seems that the new code has removed the configuration for the log, so it cannot log the error.

@nqtuyen
Copy link
Author

nqtuyen commented Jan 14, 2022

pls add some code below to ConfigureService in Program.cs to fix this (before line GlobalConfiguration.WebRootPath):

Log.Logger = new LoggerConfiguration()
                   .ReadFrom.Configuration(builder.Configuration)
                   .CreateLogger();

builder.Logging.AddSerilog();

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

No branches or pull requests

1 participant