locked
Data Points - Logging SQL and Change-Tracking Events in EF Core RRS feed

  • General discussion

  • Julie Lerman introduces you to the new logging APIs in .NET Core, concentrating on SQL and change-tracking events, with a focus on providers that output to the console and the debugger.

    Read this article in the October 2018 issue of MSDN Magazine

    Monday, October 1, 2018 7:23 PM

All replies

  • Hey friends. The 2.2 version of .NET core introduced a simpler way to define an ILoggerFactory for the console. The filtering you learn about in this article doesn't change but the syntax for defining it does. If you use the above code you'll get a warning that the ConsoleLoggerProvider is obsolete even though it will still work. I wrote a blog post about the newer, simpler syntax at http://thedatafarm.com/data-access/logging-in-ef-core-2-2-has-a-simpler-syntax-more-like-asp-net-core/.

    Julie Lerman, Author of Programming Entity Framework, MVP

    Tuesday, January 1, 2019 4:25 PM
  • Can we add custom messages in the log like we can do using EF6

    using (var context = new BookStore())
    {
        context.Database.Log = Console.Write;
        context.Database.Log("Custom message");
    }

    I need to add custom messages to the log in EF core

    MW

    Tuesday, May 14, 2019 1:14 PM