Giter Site home page Giter Site logo

Comments (6)

Guillaume-Fortin avatar Guillaume-Fortin commented on August 16, 2024

Can you give me a possibility to disable database request in console application without disable console log in Asp.Net CORE application?
I think npgsql request debug information is define as Information trace level and not on debug trace level.
If i define min log level on "Information", i view all request in logger. So, poor performance.
what I did not understand?

from efcore.pg.

roji avatar roji commented on August 16, 2024

@Thetyne I don't understand... Are you talking about Npgsql's logging capabilities or about Entity Framework Code? If it's Npgsql then it belongs in the Npgsql repo. Most of Npgsql's logging is done on level debug (except for warnings and errors).

from efcore.pg.

Guillaume-Fortin avatar Guillaume-Fortin commented on August 16, 2024

i define like this:
`
var sqlLoggerFactory = new LoggerFactory();
sqlLoggerFactory.AddConsole(Configuration.GetSection("SqlLogging"));

entityFramework = entityFramework.AddEntityFrameworkNpgsql().AddDbContext(options =>
options.UseNpgsql(WebAppConfiguration.DatabaseConnectionString).UseLoggerFactory(sqlLoggerFactory));`

If i define in appsettings.json:
"SqlLogging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Information",
"System": "Information",
"Microsoft": "Information"
}
}
I view sql request in logger.

But if i change "Microsoft": "Information" by "Microsoft": "Critical", the trace of sql request disappear.

I think i don't unserstand something about Log level.

from efcore.pg.

roji avatar roji commented on August 16, 2024

This is a question specific to Microsoft's logging package and isn't really related to Npgsql.

But looking at your config, everything seems to make sense... Saying "Information" means "Information and above" (so also error, critical..), saying "Critical" means "only critical". So it makes sense for all logging to disappear - that's what you asked for...

from efcore.pg.

Guillaume-Fortin avatar Guillaume-Fortin commented on August 16, 2024

Ok, thanks for this explication

from efcore.pg.

roji avatar roji commented on August 16, 2024

AFAIK this is has been done although there may be various missing places, will address those as they come up.

from efcore.pg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.