简体   繁体   中英

How to override default logging information in ASP.NET Core

When I start default ASP.NET Core application I got the following lines in console:

Hosting environment: Production
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.

Where I can change this logs?

Those lines are not logged, instead they are printed to the console. What is causing this output is the WebHost.Run() which is the default way to start your application. Or in particular, the internal RunAsync() which sets everything up.

You cannot change the output without writing that code yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM