Skip to content

EventSource improvements for text logging #12730

Closed

Description

@noahfalk

From an email thread with Krzysztof Cwalina and Pavel Krymets we were discussing that EventSource has rough edges when you try to use it for textual logging:

This is pretty much all I would have, built-in sinks, built-in simple text source, support for Azure functions (whether it needs multitenancy or not).

One other issue I’ve seen is a performance of in-process EventSource listener, there are a lot of allocations per event.

Activity

  1. pakrym commented on May 21, 2019

    @pakrym
    Contributor
    • No good way to log Exception objects directly
  2. pakrym commented on May 23, 2019

    @pakrym
    Contributor
    • Limited size of payload that forces us to roll out our own payload splitting mechanism
  3. noahfalk commented on May 23, 2019

    @noahfalk
    MemberAuthor

    What scale of payload do you need to log?

  4. noahfalk commented on May 23, 2019

    @noahfalk
    MemberAuthor

    For exceptions do you have any particular expectations for what the serialized format is?

  5. pakrym commented on May 24, 2019

    @pakrym
    Contributor

    For in-process listeners, I'd like to be able to pass Exception instance and strings of arbitrary length around. The problem is that it doesn't work with ETW.

  6. noahfalk commented on May 24, 2019

    @noahfalk
    MemberAuthor

    The context of this issue is that EventSource events were getting serialized as a string so they could be put into a text log. That requires the runtime to convert the exception into a string of some form. If you want to pass around exception object instances and get references back as-is from an in-proc sink that sounds like a scenario DiagnosticsSource was aiming to handle. If you also didn't want to use DiagnosticsSource for whatever reason but you did want the sink to receive an instance of arbitrary Exceptions then we should probably revisit the overall scenario because that wasn't the trajectory I thought we were on.

  7. pakrym commented on May 24, 2019

    @pakrym
    Contributor

    Let me clarify where I'm coming from. Even if we add support for console text logging to EventSource we would still need a way to forward events from EventSource to ILogger for scenarios where the library is used in ASP.NET Core environment.

    So you are right that this is not a request for purely "text logging" improvement, more something we would need to have if EventSource would be the only logging mechanism used by the library.

  8. noahfalk commented on May 24, 2019

    @noahfalk
    MemberAuthor

    Gotcha - I just opened dotnet/coreclr#24773 which I think is a little more targeted at your aim.

  9. davidfowl commented on Jun 5, 2019

    @davidfowl
    Member

    I got another one to add about object lifetime, thread safety and testability. I've spent the last day fighting with EventSource and EventListener trying to write a set of unit tests that run in parallel. Even when creating objects that look like they don't mutate global state, it seems like they still do. I think it's a massive design flaw of the current object model to do things implicitly like that.

  10. transferred this issue fromdotnet/coreclron Jan 31, 2020
  11. added this to the Future milestone on Jan 31, 2020
  12. ghost added
    backlog-cleanup-candidate
    on Dec 5, 2023
  13. ghost closed this as completedon Dec 19, 2023
  14. locked and limited conversation to collaborators on Jan 18, 2024
  15. ghost removed
    backlog-cleanup-candidate
    on Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions