Giter Club home page Giter Club logo

Comments (6)

msmolka avatar msmolka commented on June 2, 2024

There should not be any issue with postgress.

However there can be issue with global logging configuration. If you are not using any filters for this logger and adding it in the same way as AddDebug or AddConsole, you can have such problem, because EF Core is using logging internally, so it tries to use logger which depends on it.
Try add and use logging filters and exclude all Entity Framework Core logs from storing them in database.
See https://github.com/msmolka/ZNetCS.AspNetCore.Logging.EntityFrameworkCore/blob/master/test/ZNetCS.AspNetCore.Logging.EntityFrameworkCoreTest/StartupSimple.cs, as example.

In short you should exclude any EFC internal logging from being handled by this logger. Let me know if this filter works.

from znetcs.aspnetcore.logging.entityframeworkcore.

msmolka avatar msmolka commented on June 2, 2024

If you still have issue with logger after exclude EF Core logs from logger please provide small example and I will try to analyse and solve.
I personally tested it with MySQL, MariaDB, SQL Server, InMemory databases and it worked.

from znetcs.aspnetcore.logging.entityframeworkcore.

mateusleonardi avatar mateusleonardi commented on June 2, 2024

It wasn't working anyway so I created my own logger.

Thank you for the attention.

from znetcs.aspnetcore.logging.entityframeworkcore.

msmolka avatar msmolka commented on June 2, 2024

I was wonder what was wrong, in my opinion all should work. But ok, closing.

from znetcs.aspnetcore.logging.entityframeworkcore.

pdesterlich avatar pdesterlich commented on June 2, 2024

If anyone is interested, suggested solution from @msmolka works.

I had the same problems reported by @mateusleonardi with different databases (mariadb, sql server and sqlite), giving different errors but anyway not working (working fine where i removed database logging).

If i add a filter to ignore microsoft and system logs (and add "Microsoft.Extensions.Logging.Filter" to dependencies) everything works fine (both app and database logs)

edit: you can find a sample working project at https://github.com/pdesterlich/LoggingTest

from znetcs.aspnetcore.logging.entityframeworkcore.

msmolka avatar msmolka commented on June 2, 2024

@pdesterlich thank for more testing and confirmation. I'm using this library on daily basis and the only issue is to make sure you are not logging (using this logger) anything related to Microsoft.EntityFrameworkCore.
This is because each log of EFCore will cause to log. So obviously Stack Overflow

from znetcs.aspnetcore.logging.entityframeworkcore.

Related Issues (4)

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.